aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorBrandon <brandon@bremaweb.com>2016-07-10 00:08:26 -0500
committerparamat <mat.gregory@virginmedia.com>2017-05-03 03:12:45 +0100
commitbd921a7916f0fafc493b1c4d0eeb5e2bb1d6a7c2 (patch)
tree55f92cc02fce2acc9bb041a34de3c474b894bd00 /doc/lua_api.txt
parentf1d7a26b7c341b468f34325cec5c3d495f175a8f (diff)
downloadminetest-bd921a7916f0fafc493b1c4d0eeb5e2bb1d6a7c2.tar.gz
minetest-bd921a7916f0fafc493b1c4d0eeb5e2bb1d6a7c2.tar.bz2
minetest-bd921a7916f0fafc493b1c4d0eeb5e2bb1d6a7c2.zip
Sound API: Add fading sounds
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 479e38a2e..77ffb88e2 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -456,11 +456,13 @@ Examples of sound parameter tables:
-- Play locationless on all clients
{
gain = 1.0, -- default
+ fade = 0.0, -- default, change to a value > 0 to fade the sound in
}
-- Play locationless to one player
{
to_player = name,
gain = 1.0, -- default
+ fade = 0.0, -- default, change to a value > 0 to fade the sound in
}
-- Play locationless to one player, looped
{
@@ -2587,6 +2589,11 @@ These functions return the leftover itemstack.
* `spec` is a `SimpleSoundSpec`
* `parameters` is a sound parameter table
* `minetest.sound_stop(handle)`
+* `minetest.sound_fade(handle, step, gain)`
+ * `handle` is a handle returned by minetest.sound_play
+ * `step` determines how fast a sound will fade.
+ Negative step will lower the sound volume, positive step will increase the sound volume
+ * `gain` the target gain for the fade.
### Timing
* `minetest.after(time, func, ...)`