Class: SystemPlaySong

SystemPlaySong

A way to play a song

new SystemPlaySong (kind, json)

Name Type Description
kind SongKind The kind of song to play
json Object optional Json object describing the play song
Properties:
Name Type Argument Default Description
SystemPlaySong.previousMusic number <optional>
null The music that was previously played (before the current)
SystemPlaySong.currentPlayingMusic number <optional>
null The current playing music
kind SongKind The kind of song to play
songID SystemValue The song ID value
volume SystemValue The volume value
isStart boolean Indicate if is start
start SystemValue The start value
isEnd boolean Indicate if is end
end SystemValue The end value

Methods

read (json)

Read the JSON associated to the play song
Name Type Description
json Object Json object describing the play song

setDefault ()

Set song play to default values

initialize ()

Initialize (for music effects)

updateValues (songID, volume, isStart, start, isEnd, end)

Update all the specified values
Name Type Description
songID SystemValue The song ID
volume SystemValue The volume to play
isStart boolean Indicate if there's a start value
start SystemValue The start of the song to play
isEnd boolean Indicate if there's a end value
end SystemValue The end of the song to play

playMusic (start, volume)

Play the music
Name Type Description
start number optional The start of the song to play
volume number optional The volume to play

playSound ()

Play the sound

playMusicEffect (currentState)number

Play the music effect and return the next node value
Name Type Description
currentState Object The current state of the playing music effect
Returns:
Type Description
number