Class GameScript
java.lang.Object
de.gurkenlabs.litiengine.scripting.AbstractScript<Object>
de.gurkenlabs.litiengine.scripting.GameScript
- All Implemented Interfaces:
ScriptInstance
Base class for scripts attached to the game lifecycle.
-
Field Summary
Fields inherited from class AbstractScript
globals -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidattached()Called after the context is installed and the script becomes active.protected final voiddetached()Called before context-owned resources are released.voidexit()Exits and terminates the game.voidLoads an environment map.voidLoads an environment map by map name.protected voidCalled after the binding enters the running game lifecycle.protected voidCalled before the binding leaves the game lifecycle.voidPlays a background music track by resource name.voidPlays a sound effect by resource name.voidStops currently playing music.Methods inherited from class AbstractScript
attach, camera, context, detach, environment, globals, host, input, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheel, onRender, render, spawn, spawn, spawn, spawn, spawnCreature, spawnCreature, spawner, spawnProp, spawnProp, uiMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ScriptInstance
update
-
Constructor Details
-
GameScript
public GameScript()
-
-
Method Details
-
attached
Description copied from class:AbstractScriptCalled after the context is installed and the script becomes active.- Overrides:
attachedin classAbstractScript<Object>- Throws:
Exception- if initialization fails.
-
detached
Description copied from class:AbstractScriptCalled before context-owned resources are released.- Overrides:
detachedin classAbstractScript<Object>- Throws:
Exception- if cleanup fails.
-
onStarted
-
onStopped
-
loadMap
Loads an environment map by map name. -
loadMap
Loads an environment map. -
playSound
Plays a sound effect by resource name. -
playMusic
Plays a background music track by resource name. -
stopMusic
public void stopMusic()Stops currently playing music. -
exit
public void exit()Exits and terminates the game.
-