-
Notifications
You must be signed in to change notification settings - Fork 0
Trigger API Reference DCEI Functions Sound0
Trigger API Reference\DCEI Functions\Sound {Trigger-API-ReferenceDCEI-FunctionsSound}
bool IsMusicEnabled()
Returns if the music is enabled or not.
bool IsSoundEnabled()
Returns if the sound is enabled.
void PlayMusic(string name, bool smoothTransition) {void-PlayMusicstring-name-bool-smoothTransition}
void PlayMusic(string name, bool smoothTransition)
Plays the specified song on repeat. This will replace the default music played. Music must be declared in Music Settings.
-
string
name
the name of the music asset to play. Accepted music names:Battle1 Battle2 Battle3 Hometown1 Boss1
-
bool
smoothTransition
if we want a smooth transition from current music to this one
DCEI.PlayMusic("Boss1", true)
void SetMusicVolume(float volume)
DCEI.SetMusicVolume(0.5)
void PauseMusic()
Pauses the music currently playing. Cannot be used on the game's first frame as the music hasn't initialized yet.
function OnClickRMB()
DCEI.PauseMusic()
end
DCEI.TriggerAddMouseDownEvent(1, OnClickRMB)
void ResumeMusic()
Resumes paused music. If music is currently not paused, restarts the music currently playing.
function OnClickLMB()
DCEI.ResumeMusic()
end
DCEI.TriggerAddMouseDownEvent(0, OnClickLMB)
void PlaySound(string nameOrPath, float volume)
Plays the given sound at the given volume. A given volume of 0 will playback at the default volume. While volume doesn't have an explicit maximum value, it's recommended to keep this under 5.
-
string
nameOrPath
the name of the sound or path to the sound. -
float
volume
the playback volume for the sound.
DCEI.PlaySound("ancienttree_ability_01", 0.5)
void PlaySoundForPlayer(string nameOrPath, int playerId, float volume) {void-PlaySoundForPlayerstring-nameOrPath-int-playerId-float-volume}
void PlaySoundForPlayer(string nameOrPath, int playerId, float volume)
Play sound for a specific player. Only useful in multiplayer.