DIFF

class GameGAME_TEMPLATESource

Members 1

Methods 25

ScriptModule GetScriptModule()GAME_TEMPLATE
References GameScript
void SetDebug(bool isDebug)GAME_TEMPLATE
void OnEvent(EventType eventTypeId, Param params)GAME_TEMPLATE

Called when some system event occur.

eventTypeId
event type.
params
Param object, cast to specific param class to get parameters for particular event.
References Print()
void OnAfterInit()GAME_TEMPLATE

Called after full initialization of Game instance

References Print()
void OnUpdate(float timeslice)GAME_TEMPLATE

Called on World update

timeslice
time elapsed from last call
proto native bool SetWorldFile(string path, bool reload)GAME_TEMPLATE

Sets world file to be loaded. Returns false if file doesn't exist.

path
Path to the ent file
reload
Force reload the world
proto native owned string GetWorldFile()GAME_TEMPLATE

Returns path of world file loaded

bool OnGameStart()GAME_TEMPLATE

Event which is called right before game starts (all entities are created and initialized). Returns true if the game can start.

void OnGameEnd()GAME_TEMPLATE

Event which is called right before game end.

void ShowLoadingAnim()GAME_TEMPLATE

Creates loading screen

void HideLoadingAnim()GAME_TEMPLATE

Hides loading screen

void UpdateLoadingAnim(float timeslice, float progress)GAME_TEMPLATE

Used for updating the loading screen

timeslice
progress
loading progress between 0 and 1
proto native IEntity SpawnEntity(typename typeName)GAME_TEMPLATE

Safely instantiate the entity and calls EOnInit if the entity sets event mask EntityEvent.INIT.

typename
Name of entity's type to instantiate.

Returns: instantiated entity

proto native IEntity SpawnEntityTemplate(vobject templateResource)GAME_TEMPLATE

Safely instantiate the entity from template (with all components) and calls EOnInit if the entity sets event mask EntityEvent.INIT.

templateResource
Template resource of the entity to instantiate.

Returns: instantiated entity

proto native GenericComponent SpawnComponentTemplate(IEntity owner, vobject templateResource)GAME_TEMPLATE

Safely instantiate the component from template, insert it to entity and calls EOnInit if the component sets event mask EntityEvent.INIT.

owner
Entity which will own the component
templateResource
Template resource of the component to instantiate.

Returns: instantiated component

proto native IEntity FindEntity(string name)GAME_TEMPLATE
proto native WorkspaceWidget GetWorkspace()GAME_TEMPLATE
proto native void RequestClose()GAME_TEMPLATE

Setting request flag for engine to exit the game

proto native void RequestReload()GAME_TEMPLATE

Setting request flag for the engine to reinitialize the game Doesn't do anything in Workbench

proto native owned string GetBuildVersion()GAME_TEMPLATE

Returns version of the game

proto native owned string GetBuildTime()GAME_TEMPLATE

Returns date and time when the game was built

proto native GenericWorldEntity GetWorldEntity()GAME_TEMPLATE

Returns World entity when in game or in play mode in WE. NULL otherwise.

Referenced by RenderTarget.Init()
proto native MenuManager GetMenuManager()GAME_TEMPLATE
proto native int GetTickCount()GAME_TEMPLATE