API Docs for:
Show:

GameManager Class

Module: gs

Manages all general things around the game like holding the game settings, manages the save/load of a game, etc.

Methods

createSaveGameIndex

() protected

Creates the index of all save-games. Should be called whenever a new save game is created.

dispose

()

Disposes the GameManager. Should be called before quit the game.

exit

()

Quits the game. The implementation depends on the platform. So for example on mobile devices this method has no effect.

exitGame

()

Exists the game and resets the GameManager which is important before going back to the main menu or title screen.

getSaveGame

(
  • slot
)
Object

Gets the save game data for a specified slot.

Parameters:

  • slot Number
    • The slot to get the save data from.

Returns:

Object:

The save game data.

initialize

()

Initializes the GameManager, should be called before the actual game starts.

load

(
  • slot
)

Loads the game from the specified save game slot. This method triggers a automatic scene change.

Parameters:

  • slot Number
    • The slot where the game should be loaded from.

newGame

()

Starts a new game.

reset

()

Resets the GameManager by disposing and re-initializing it.

resetGlobalData

()

Resets current global data. All stored data about read messages, persistent variables and CG gallery will be deleted.

resetSettings

()

Resets the game's settings to its default values.

save

(
  • slot
  • thumbWidth
  • thumbHeight
)

Saves the current game at the specified slot.

Parameters:

  • slot Number
    • The slot where the game should be saved at.
  • thumbWidth Number
    • The width for the snapshot-thumb. You can specify null or 0 to use an auto calculated width.
  • thumbHeight Number
    • The height for the snapshot-thumb. You can specify null or 0 to use an auto calculated height.

saveGlobalData

()

Saves current global data.

saveSettings

()

Saves current game settings.

setupCommonEvents

()

Sets up common events.

setupCursor

()

Sets up cursor depending on system settings.

update

()

Updates the GameManager. Should be called once per frame.

Properties

backlog

Object

The game's backlog.

chapters

gs.Document

The game's chapter

characterParams

Object

Character parameters by character ID.

commonEvents

gs.Object_CommonEvent

The list of common events.

commonEvents

gs.Object_CommonEvent

Indicates if the GameManager is initialized.

defaults

Object

Stores default values for backgrounds, pictures, etc.

globalData

Object

Stores global data like the state of persistent game variables.

inLivePreview

Object

Indicates if the game runs in editor's live-preview.

messages

Object

The game's current displayed messages. Especially in NVL mode the messages of the current page are stored here.

saveGameSlots

Object

The index of save games. Contains the header-info for each save game slot.

saveSlotCount

Number

Count of save slots. Default is 100.

sceneData

Object

The current scene data.

sceneViewport

gs.Object_Viewport

The scene viewport containing all visual objects which are part of the scene and influenced by the in-game camera.

tempFields

Object

Temporary game fields.

tempSettings

Object

Temporary game settings.