Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
|
A music. More...
#include <header.hpp>
Public Member Functions | |
Music () | |
Default constructor. | |
nil | LoadFromFile (string Filename) |
Open a music file (doesn't play it -- call Play() for that) Note: the working directory is the mode's root directory. | |
number | GetDuration () |
Get the music duration. | |
number | GetChannelsCount () |
Return the number of channels (1 = mono, 2 = stereo, ...) | |
nil | Play () |
Play the sound. | |
nil | Pause () |
Pause the sound. | |
nil | Stop () |
Stop the sound. | |
nil | SetLoop (bool Loop) |
Set the sound loop state. | |
nil | SetPitch (number Pitch) |
Set the sound pitch. | |
nil | SetVolume (number Volume) |
Set the sound volume. | |
bool | GetLoop () |
Tell whether or not the sound is looping. | |
number | GetPitch () |
Get the pitch. | |
number | GetVolume () |
Get the volume. | |
number | GetPlayingOffset () |
Get the current playing position of the sound. | |
bool | IsPlaying () |
Return true if the music is playing. |
A music.
Note: a music is not attached to a screen. It can be played by itself.
Music::Music | ( | ) |
Default constructor.
number Music::GetChannelsCount | ( | ) |
Return the number of channels (1 = mono, 2 = stereo, ...)
number Music::GetDuration | ( | ) |
Get the music duration.
bool Music::GetLoop | ( | ) |
Tell whether or not the sound is looping.
number Music::GetPitch | ( | ) |
Get the pitch.
number Music::GetPlayingOffset | ( | ) |
Get the current playing position of the sound.
number Music::GetVolume | ( | ) |
Get the volume.
bool Music::IsPlaying | ( | ) |
Return true if the music is playing.
nil Music::LoadFromFile | ( | string | Filename | ) |
Open a music file (doesn't play it -- call Play() for that) Note: the working directory is the mode's root directory.
Filename | : Path of the music file to open |
nil Music::Pause | ( | ) |
Pause the sound.
nil Music::Play | ( | ) |
Play the sound.
nil Music::SetLoop | ( | bool | Loop | ) |
Set the sound loop state.
This parameter is disabled by default
Loop | : True to play in loop, false to play once |
nil Music::SetPitch | ( | number | Pitch | ) |
Set the sound pitch.
The default pitch is 1
Pitch | : New pitch |
nil Music::SetVolume | ( | number | Volume | ) |
Set the sound volume.
The default volume is 100
Volume | : Volume (in range [0, 100]) |
nil Music::Stop | ( | ) |
Stop the sound.