Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |