Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Game Class Reference

Base game class. More...

Inheritance diagram for Dragengine.Game:
Dragengine.BaseGameApp Dragengine.TestSystem.BaseGameAppTesting Dragengine.TestSystem.TestGameApp

Public Member Functions

Management
void initGame ()
 Called by game engine to init game.
void cleanUp ()
 Called by the game engine to clean up before the game exits.
void inputEvent (InputEvent event)
 Process input event.
void userRequestedQuit ()
 User requested window to be closed.
void onFrameUpdate ()
 Called by the game engine at the beginning of each frame update.
void onResizeRenderWindow ()
 Size of the render window changed.
void onAppActivate ()
 Called after the application received or lost focus.
int getArgumentCount ()
 Number of command line arguments given to the game.
String getArgumentAt (int index)
 Command line argument given to the game.
String getRestartInfo ()
 Information passed to Engine.restart(String) before restarting.

Protected Member Functions

Constructors
Game new ()
 Create game.

Detailed Description

Base game class.

This is the basic game object for your game application. You have to create a single subclass. of this class handling your game. The DragonScript script module examines all scripts for the presence of this one subclass and creates a single instance from it. The single instance is also available from Engine.getGame().

This is a native class. You have to subclass this class exactly once.

Member Function Documentation

◆ cleanUp()

void Dragengine.Game.cleanUp ( )

Called by the game engine to clean up before the game exits.

Make sure to free all data acquired during the run of the game. This is the last method called in the script before the engine terminates.

Reimplemented in Dragengine.TestSystem.BaseGameAppTesting.

References cleanUp().

Referenced by cleanUp(), and Dragengine.BaseGameApp.getSkinAnnotations().

◆ getArgumentAt()

String Dragengine.Game.getArgumentAt ( int index)

Command line argument given to the game.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getArgumentCount().

References getArgumentCount().

Referenced by getRestartInfo().

◆ getArgumentCount()

int Dragengine.Game.getArgumentCount ( )

Number of command line arguments given to the game.

References onAppActivate().

Referenced by getArgumentAt().

◆ getRestartInfo()

String Dragengine.Game.getRestartInfo ( )

Information passed to Engine.restart(String) before restarting.

Version
1.23

If starting normally returns empty string.

References getArgumentAt(), and getRestartInfo().

Referenced by getRestartInfo().

◆ initGame()

void Dragengine.Game.initGame ( )

Called by game engine to init game.

This function has to load all data needed to start working. Do not enter a loop inside this method. The game engine handles the game loop.

Reimplemented in Dragengine.BaseGameApp, Dragengine.TestSystem.BaseGameAppTesting, and Dragengine.TestSystem.TestGameApp.

References initGame().

Referenced by initGame().

◆ inputEvent()

void Dragengine.Game.inputEvent ( InputEvent event)

◆ new()

Game Dragengine.Game.new ( )
protected

Create game.

Reimplemented in Dragengine.BaseGameApp, Dragengine.TestSystem.BaseGameAppTesting, and Dragengine.TestSystem.TestGameApp.

References new().

Referenced by new().

◆ onAppActivate()

void Dragengine.Game.onAppActivate ( )

Called after the application received or lost focus.

Returns
true if the call has been successfull or false otherwise
Version
1.22

Reimplemented in Dragengine.BaseGameApp.

Referenced by getArgumentCount().

◆ onFrameUpdate()

void Dragengine.Game.onFrameUpdate ( )

Called by the game engine at the beginning of each frame update.

Use this method to advance your game by Engine.getElapsedTime() seconds.

Reimplemented in Dragengine.TestSystem.BaseGameAppTesting, and Dragengine.TestSystem.TestGameApp.

Referenced by Dragengine.BaseGameApp.getMouseSensitivity(), and onResizeRenderWindow().

◆ onResizeRenderWindow()

void Dragengine.Game.onResizeRenderWindow ( )

Size of the render window changed.

Reimplemented in Dragengine.TestSystem.BaseGameAppTesting.

References onFrameUpdate(), and onResizeRenderWindow().

Referenced by Dragengine.BaseGameApp.getBehaviorCount(), and onResizeRenderWindow().

◆ userRequestedQuit()

void Dragengine.Game.userRequestedQuit ( )

User requested window to be closed.

Default implementation calls quitGame().

Reimplemented in Dragengine.TestSystem.BaseGameAppTesting.

References userRequestedQuit().

Referenced by Dragengine.BaseGameApp.addBehavior(), and userRequestedQuit().


The documentation for this class was generated from the following file: