Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
|
#include <header.hpp>
Public Member Functions | |
nil | Stop () |
Stop and destoy this SoundPlayer. | |
nil | SetSound (En::Sound buffer) |
Set the buffer for that sound and protect it. | |
nil | SetLoop (bool isLoop) |
Set the sound loop state. | |
nil | SetPitch (number pitch) |
Set the sound pitch. | |
nil | SetVolume (number volume) |
Set the sound volume. | |
nil | SetPosition (number x, number y, number z) |
Set the sound position (take 3 values). | |
nil | SetPosition (Vector3D position) |
Set the sound position (take a 3D vector). | |
nil | SetMinDistance (number minDistance) |
Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum volume. | |
nil | SetAttenuation (number attenuation) |
Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener. | |
nil | SetPlayingOffset (number timeOffset) |
Set the current playing position of the sound param timeOffset : New playing position, expressed in seconds. | |
bool | GetLoop () |
Tell whether or not the sound is looping return True if the sound is looping, false otherwise. | |
number | GetPitch () |
Get the pitch return Pitch value. | |
number | GetVolume () |
Get the volume return Volume value (in range [1, 100]) | |
Vector3D | GetPosition () |
Get the sound position return Position of the sound in the world. | |
bool | IsRelativeToListener () |
Tell if the sound's position is relative to the listener's position, or if it's absolute return True if the position is relative, false if it's absolute. | |
number | GetMinDistance () |
Get the minimum distance return Minimum distance for the sound. | |
number | GetAttenuation () |
Get the attenuation factor return Attenuation factor of the sound. | |
number | GetPlayingOffset () |
Get the current playing position of the sound return Current playing position, expressed in seconds. |
number SoundPlayer::GetAttenuation | ( | ) |
Get the attenuation factor return Attenuation factor of the sound.
bool SoundPlayer::GetLoop | ( | ) |
Tell whether or not the sound is looping return True if the sound is looping, false otherwise.
number SoundPlayer::GetMinDistance | ( | ) |
Get the minimum distance return Minimum distance for the sound.
number SoundPlayer::GetPitch | ( | ) |
Get the pitch return Pitch value.
number SoundPlayer::GetPlayingOffset | ( | ) |
Get the current playing position of the sound return Current playing position, expressed in seconds.
Vector3D SoundPlayer::GetPosition | ( | ) |
Get the sound position return Position of the sound in the world.
number SoundPlayer::GetVolume | ( | ) |
Get the volume return Volume value (in range [1, 100])
bool SoundPlayer::IsRelativeToListener | ( | ) |
Tell if the sound's position is relative to the listener's position, or if it's absolute return True if the position is relative, false if it's absolute.
nil SoundPlayer::SetAttenuation | ( | number | attenuation | ) |
Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener.
The default attenuation factor 1.0 param attenuation : New attenuation factor for the sound
nil SoundPlayer::SetLoop | ( | bool | isLoop | ) |
Set the sound loop state.
This parameter is disabled by default param isLoop : True to play in loop, false to play once
nil SoundPlayer::SetMinDistance | ( | number | minDistance | ) |
Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum volume.
The default minimum distance is 1.0 param minDistance : New minimum distance for the sound
nil SoundPlayer::SetPitch | ( | number | pitch | ) |
Set the sound pitch.
The default pitch is 1 param pitch : New pitch
nil SoundPlayer::SetPlayingOffset | ( | number | timeOffset | ) |
Set the current playing position of the sound param timeOffset : New playing position, expressed in seconds.
nil SoundPlayer::SetPosition | ( | number | x, |
number | y, | ||
number | z | ||
) |
Set the sound position (take 3 values).
The default position is (0, 0, 0) param x, y, z : Position of the sound in the world
nil SoundPlayer::SetPosition | ( | Vector3D | position | ) |
Set the sound position (take a 3D vector).
The default position is (0, 0, 0) param Position : Position of the sound in the world
nil SoundPlayer::SetSound | ( | En::Sound | buffer | ) |
Set the buffer for that sound and protect it.
nil SoundPlayer::SetVolume | ( | number | volume | ) |
Set the sound volume.
The default volume is 100 (max) param Volume : volume (in range [0, 100])
nil SoundPlayer::Stop | ( | ) |
Stop and destoy this SoundPlayer.