Skip to content

SceneState

A helper class to manage the state of a scene.

Type parameters

Type parameter
T

Constructors

new SceneState(name, saveData)

new SceneState<T>(name, saveData?): SceneState<T>

Parameters

ParameterType
namestring
saveData?() => any

Returns

SceneState<T>

Source

kiboom.d.ts:146

Methods

changeScene()

changeScene(scene, …args): void

Change the scene to the given scene saving the current scene data.

Parameters

ParameterTypeDescription
scenestringThe name of the scene to go to
argsany[]Arguments for scene

Returns

void

Source

kiboom.d.ts:164


getData()

getData(key, defaultValue?): T[keyof T]

Get the persistent data of the scene.

Parameters

ParameterType
keykeyof T
defaultValue?T[keyof T]

Returns

T[keyof T]

Source

kiboom.d.ts:152


saveSceneData()

saveSceneData(): void

Save the persistent data of the scene.

Returns

void

Source

kiboom.d.ts:156


setBackgroundMusic()

setBackgroundMusic(music, options): void

Sets a background music for the scene.

Parameters

ParameterType
musicstring
optionsAudioPlayOpt

Returns

void

Source

kiboom.d.ts:160


setPersistentData()

setPersistentData(data): void

Set the persistent data

Parameters

ParameterType
dataT

Returns

void

Source

kiboom.d.ts:148

Properties

PropertyType
backgroundMusicAudioPlay
dataT
namestring
saveData?() => T