Component_LayoutSceneBehavior Class
The base class of all scene-behavior components. A scene-behavior component define the logic of a single game scene.
Item Index
Methods
- createControl
- dispose
- disposeControl
- emitEvent
- enterFullScreen
- executeAnimation
- executeBindings
- executeBindings
- executeFormulas
- exitGame
- fullRefreshObject
- initialize
- leaveFullScreen
- loadGame
- newGame
- playSound
- playVoice
- prepareData
- prepareSaveGame
- prepareVisual
- previousLayout
- quitGame
- refreshObject
- resetGlobalData
- saveGame
- saveSettings
- selectLanguage
- show
- switchGameScene
- switchLayout
- switchScene
- toggleFullScreen
- turnOffMusic
- turnOffSound
- turnOffVoice
- turnOnMusic
- turnOnOffMusic
- turnOnOffSound
- turnOnOffVoice
- turnOnSound
- turnOnVoice
- updateContent
Methods
createControl
-
sender -
params
Action method which creates a new control from the specified descriptor.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsString- Contains the descriptor and other data needed to construct the control.
- params.descriptor - The control' descriptor. Can be a direct descriptor definition or a template name
- params.parent - A binding-expression which returns the control's parent.
- params.senderData - An object containing additional data merged into the control object.
dispose
()
Disposes the scene.
disposeControl
-
sender -
params
Action method which disposes the specified control.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsString- The ID of the control to dispose. Can be a binding-expression.
emitEvent
-
sender -
params
Action method which emits the specified event.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Contains event name, source and data.
- params.name - The name of the event to emit
- params.source - A binding-expression to define the game object which should emit the event.
- params.data - An object containing additional event specific data.
enterFullScreen
-
sender -
params
Action method which enters fullscreen mode.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean- Can be null
executeAnimation
-
sender -
params
Action method which executes an animation on a specified target game object.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Contains target-id and animations: { target, animations }
executeBindings
-
sender -
params
Action method which executes the specified bindings.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- An array of binding-definitions.
executeBindings
-
sender -
params
Action method which changes the game's aspect ratio.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean- If true the game screen will stretched so that it fills the entire screen of the player without any black borders. Otherwise the game screen stretches but keeps its ratio so black borders are possible if the game resolution's ratio and the target display's ratio are not match. It can also be a binding-expression.
executeFormulas
-
sender -
params
Action method which executes the specified formulas.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsui.Formula- An array of formula-definitions.
exitGame
-
sender -
params
Action method which exists the current game. It doesn't change the scene and should be called before switching back to the title screen or main menu.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Can be null
fullRefreshObject
-
sender -
params
Action method which triggers a full refresh on the object returned by the specified binding-expression. The params must be a direct binding-expression string.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsString- The binding expression.
initialize
()
Initializes the scene.
leaveFullScreen
-
sender -
params
Action method which leaves fullscreen mode.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean- Can be null
loadGame
-
sender -
params
Action method which loads the game from the specified save slot.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Contains the slot-index where the game should be loaded from.
- params.slot - The slot-index where the game should be loaded from. Can be a binding-expression.
newGame
-
sender -
params
Action method which starts a new game.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Can be null
playSound
-
sender -
params
Action method which plays the specified sound.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- The sound to play.
playVoice
-
sender -
params
Action method which plays the specified voice.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- The voice to play.
prepareData
()
Prepares all data for the scene and loads the necessary graphic and audio resources.
prepareSaveGame
-
sender -
params
Action method which prepares the game for saving by taking a snapshot of the current game state and storing it in GameManager.saveGame.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Can be null.
prepareVisual
()
Prepares all visual game object for the scene.
previousLayout
-
sender -
params
Action method which returns to previous layout. (If savePrevious was set to true on switchLayout.).
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Can be null.
quitGame
-
sender -
params
Action method which quits the game.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsString- Can be null.
refreshObject
-
sender -
params
Action method which triggers a refresh on the object returned by the specified binding-expression. The params must be a direct binding-expression string.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsString- The binding expression.
resetGlobalData
-
sender -
params
Action method which resets global data storage.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Can be null.
saveGame
-
sender -
params
Action method which saves the current game at the specified save slot.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Contains the slot-index where the game should be saved.
- params.slot - The slot-index where the game should be saved. Can be a binding-expression.
saveSettings
-
sender -
params
Action method which saves game settings.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Can be null.
selectLanguage
-
sender -
params
Action method which selects the specified language.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsNumber | String- Index of the language to set. Can be a binding-expression.
show
-
visible
Shows/Hides the current scene. A hidden scene is no longer shown and executed but all objects and data is still there and be shown again anytime.
Parameters:
-
visibleBoolean- Indicates if the scene should be shown or hidden.
switchGameScene
-
sender -
params
Action method which switches to another game scene.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Contains the UID of the scene to switch to.
- params.uid - The UID of the scene to switch to.
switchLayout
-
sender -
params
Action method which switches to another layout.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Contains the name of the layout to switch to.
- params.name - The name of the layout to switch to.
- params.savePrevious - Indicates if the current layout should not be erased but paused and hidden instead so that it can be restored using returnToPrevious action.
- params.dataFields - Defines the data of "$dataFields" binding-expression variable. Can be a binding-expression or a direct object. Optional.
switchScene
-
sender -
params
Action method which switches to another scene.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsObject- Contains the class name of the scene to switch to.
- params.name - The class-name of the scene to switch to. The class must be defined in vn-namespace.
toggleFullScreen
-
sender -
params
Action method which toggles between window and fullscreen mode.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- Can be null
turnOffMusic
-
sender -
params
Action method which turns off music.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- Can be null.
turnOffSound
-
sender -
params
Action method which turns off sound.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- Can be null.
turnOffVoice
-
sender -
params
Action method which turns off voice.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- Can be null.
turnOnMusic
-
sender -
params
Action method which turns on music.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- Can be null.
turnOnOffMusic
-
sender -
params
Action method which turns music on or off.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- If true music will be turned on. Otherwise it will be turned off. Can also be a binding-expression.
turnOnOffSound
-
sender -
params
Action method which turns sound on or off.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- If true sound will be turned on. Otherwise it will be turned off. Can also be a binding-expression.
turnOnOffVoice
-
sender -
params
Action method which turns voice on or off.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- If true voice will be turned on. Otherwise it will be turned off. Can also be a binding-expression.
turnOnSound
-
sender -
params
Action method which turns on sound.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- Can be null.
turnOnVoice
-
sender -
params
Action method which turns on voice.
Parameters:
-
sendergs.Object_Base- The sender object.
-
paramsBoolean | String- Can be null.
updateContent
()
Updates the scene's content.
