Skip to content

Commit

Permalink
Converted ScriptingAmbientSound
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Aug 27, 2018
1 parent 18b3af2 commit 33755a8
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions mediawiki/ScriptingAmbientSound.mw
@@ -1,52 +1,52 @@
__NOTOC__
\_\_NOTOC\_\_

Summary
-------

== Summary ==
An ambient sound that was given a name can be controlled by scripts.

== Instance ==
An <tt>AmbientSound</tt> is instantiated by placing a definition inside a level. It can then be accessed by its <tt>name</tt> from a script or via <tt>sector.''name''</tt> from the console.
Instance
--------

An `AmbientSound` is instantiated by placing a definition inside a level. It can then be accessed by its `name` from a script or via `sector.`*`name`* from the console.

### Example

=== Example ===
In the level file:
<pre>
(ambient_sound
(name "niagara")
(x 10)
(y 20)
(width 100)
(height 51)
(distance_factor 0.5)
(distance_bias 0)
(sample "waterfall.wav")
(volume 1)
)
</pre>

(ambient_sound
(name "niagara")
(x 10)
(y 20)
(width 100)
(height 51)
(distance_factor 0.5)
(distance_bias 0)
(sample "waterfall.wav")
(volume 1)
)

In a script:
<pre>
niagara.set_pos(0, 0);
</pre>

niagara.set_pos(0, 0);

In the console:
<pre>
sector.niagara.set_pos(18, 35)
</pre>

== Methods ==
{| class="objectlist"
! class="method" style="vertical-align: top"| set_pos(float x, float y)
| Sets the position of the ambient sound
|-
! class="method" style="vertical-align: top"| get_pos_x()
| Returns the x coordinate.
|-
! class="method" style="vertical-align: top"| get_pos_y()
| Returns the y coordinate.
|}

== Constants ==

* ''None''

[[Template:Navbox Scripting reference]]
[[Category:Scripting Reference]]

sector.niagara.set_pos(18, 35)

Methods
-------

| set\_pos(float x, float y) | Sets the position of the ambient sound |
|----------------------------|----------------------------------------|
| get\_pos\_x() | Returns the x coordinate. |
| get\_pos\_y() | Returns the y coordinate. |

Constants
---------

- *None*

[Template:Navbox Scripting reference](Template:Navbox_Scripting_reference "wikilink")

[Category:Scripting Reference](Category:Scripting_Reference "wikilink")

0 comments on commit 33755a8

Please sign in to comment.