Game scripting

Return to table of content.

List

Variables

Enumerations

Classes

Details

Variables

Return to top.

NameTypeDescription
ScriptManagerInstance ScriptManagerInstance of the script manager.
GameInstance GameInstance of the game.
SceneManagerInstance SceneManagerInstance of the scene manager.

Enumerations

RenderPosition

Return to top.

Description:
Render position of a GUI.

Values:
RP_BEFORE_BACKGROUNDRender before background.
RP_AFTER_BACKGROUNDRender after background.
RP_BEFORE_FOREGROUNDRender before foreground.
RP_AFTER_FOREGROUNDRender after foreground.

Classes

ScriptManager

Return to top.

Description:
Manager responsible of all the scripts.
constructor
Description:
ScriptManager cannot be instanciated by a script.
load
Description:
Load a script.

Parameters:
NameTypeDescription
file_namestringName of the script file.

Return:
unload
Description:
Unload a script.

Parameters:
NameTypeDescription
file_namestringName of the script file.

Return:
execute
Description:
Execute a script.

Parameters:
NameTypeDescription
file_namestringName of the script file.

Return:

Game

Return to top.

Description:
Game manager.
constructor
Description:
Game cannot be instanciated by a script.
getTimeSinceLastFrame
Description:
Get the elapsed time since the last update (in ms) of the game.

Parameters: none.
Return:
registerUpdateScript
Description:
Register the name of a script function to be called to update the game state.

Parameters:
NameTypeDescription
file_namestringName of the update function.

Return:
unregisterUpdateScript
Description:
Unregister the name of a previously registered script function.

Parameters:
NameTypeDescription
file_namestringName of the update function.

Return:

SceneManager

Return to top.

Description:
Manager responsible of all the scenes.
constructor
Description:
SceneManager cannot be instanciated by a script.
createScene
Description:
Create a scene.

Parameters:
NameTypeDescription
scene_namestringName of the scene.

Return:
removeScene
Description:
Remove a scene and unload its data.

Parameters:
NameTypeDescription
scene_namestringName of the scene.

Return:
activateScene
Description:
Activate a scene.

Parameters:
NameTypeDescription
scene_namestringName of the scene.

Return:
disableScene
Description:
Disable a scene.

Parameters:
NameTypeDescription
scene_namestringName of the scene.

Return:
getScene
Description:
Get an existing scene.

Parameters:
NameTypeDescription
scene_namestringName of the scene.

Return:

Scene

Return to top.

Description:
A scene.
constructor
Description:
Scene cannot be instanciated by a script.
getName
Description:
Get the name of the scene.

Parameters: none.
Return:
load
Description:
Load the scene from a file.

Parameters:
NameTypeDescription
file_namestringPath of the file to load.

Return:
createGUI
Description:
Create a graphical user interface (GUI).

Parameters:
NameTypeDescription
namestringName of the GUI.
file_namestringPath of the file to load.
render_positionRenderPositionPosition where the GUI will be rendered.

Return:
removeGUI
Description:
Remove a graphical user interface (GUI).

Parameters:
NameTypeDescription
namestringName of the GUI.

Return:
showGUI
Description:
Show a graphical user interface (GUI).

Parameters:
NameTypeDescription
namestringName of the GUI.

Return:
hideGUI
Description:
Hide a graphical user interface (GUI).

Parameters:
NameTypeDescription
namestringName of the GUI.

Return:
createSceneNode
Description:
Create a scene node.

Parameters:
NameTypeDescription
node_namestringName of the node.

Return:
removeSceneNode
Description:
Remove a scene node.

Parameters:
NameTypeDescription
node_namestringName of the node.

Return:
getSceneNode
Description:
Get an existing scene node.

Parameters:
NameTypeDescription
node_namestringName of the scene node.

Return:
createActor
Description:
Create an actor.

Parameters:
NameTypeDescription
namestringName of the actor.
model_namestringName of the model to use for the actor; empty if none.

Return:
removeActor
Description:
Remove an actor.

Parameters:
NameTypeDescription
actor_namestringName of the actor.

Return:
getActor
Description:
Get an existing actor.

Parameters:
NameTypeDescription
actor_namestringName of the actor.

Return:
createViewport
Description:
Create a viewport.

Parameters:
NameTypeDescription
namestringName of the viewport.
z_orderintegerZ order of the viewport.
camera_namestringName of the camera to be used initially to render the viewport.

Return:
removeViewport
Description:
Remove a viewport.

Parameters:
NameTypeDescription
namestringName of the viewport.

Return:
getViewport
Description:
Get an existing viewport.

Parameters:
NameTypeDescription
viewport_namestringName of the viewport.

Return:
createCamera
Description:
Create a camera.

Parameters:
NameTypeDescription
namestringName of the camera.

Return:
removeCamera
Description:
Remove a camera.

Parameters:
NameTypeDescription
namestringName of the camera.

Return:
getCamera
Description:
Get an existing camera.

Parameters:
NameTypeDescription
camera_namestringName of the camera.

Return:

SceneNode

Return to top.

Description:
A scene node.
constructor
Description:
SceneNode cannot be instanciated by a script.
attachActor
Description:
Attach an actor

Parameters:
NameTypeDescription
actor_namestringName of the actor.

Return:
detachActor
Description:
Detach an actor

Parameters:
NameTypeDescription
actor_namestringName of the actor.

Return:
attachCamera
Description:
Attach a camera

Parameters:
NameTypeDescription
camera_namestringName of the camera.

Return:
detachCamera
Description:
Detach a camera

Parameters:
NameTypeDescription
camera_namestringName of the camera.

Return:
createSceneNode
Description:
Create a scene node.

Parameters:
NameTypeDescription
node_namestringName of the node.

Return:
removeSceneNode
Description:
Remove a scene node.

Parameters:
NameTypeDescription
node_namestringName of the node.

Return:
getSceneNode
Description:
Get an existing scene node.

Parameters:
NameTypeDescription
node_namestringName of the scene node.

Return:
getPosition
Description:
Get the position of the scene node.

Parameters: none.
Return:
setPosition
Description:
Set the position of the scene node.

Parameters:
NameTypeDescription
positionVector3New falue for the position of the scene node.

Return:
move
Description:
Move.

Parameters:
NameTypeDescription
offsetVector3Movement offset.

Return:
getOrientation
Description:
Get the orientation of the scene node.

Parameters: none.
Return:
setOrientation
Description:
Set the orientation of the scene node.

Parameters:
NameTypeDescription
orientationQuaternionNew falue for the orientation of the scene node.

Return:
roll
Description:
Rotate around the z-axis.

Parameters:
NameTypeDescription
anglefloatRotation angle in degrees.

Return:
yaw
Description:
Rotate around the x-axis.

Parameters:
NameTypeDescription
anglefloatRotation angle in degrees.

Return:
pitch
Description:
Rotate around the y-axis.

Parameters:
NameTypeDescription
anglefloatRotation angle in degrees.

Return:

Actor

Return to top.

Description:
An actor.
constructor
Description:
Actor cannot be instanciated by a script.
getName
Description:
Get the name of the actor.

Parameters: none.
Return:
getScale
Description:
Get the scale of the actor.

Parameters: none.
Return:
setScale
Description:
Set the scale of the actor.

Parameters:
NameTypeDescription
scaleVector3New falue for the scale of the actor.

Return:
setModel
Description:
Set the model.

Parameters:
NameTypeDescription
modelstringName of the model to use.

Return:
getPhysicsState
Description:
Get the physics state of the actor.

Parameters: none.
Return:
getPhysicsMass
Description:
Get the physics mass of the actor.

Parameters: none.
Return:
setPhysicsProperties
Description:
Set the physics properties.

Parameters:
NameTypeDescription
stateboolPhysics state (true to enable physics on actor, false otherwise).
massfloatPhysics mass of the actor.

Return:

Viewport

Return to top.

Description:
A viewport.
constructor
Description:
Viewport cannot be instanciated by a script.
getName
Description:
Get the name of the viewport.

Parameters: none.
Return:
getLeft
Description:
Get the left position of the viewport.

Parameters: none.
Return:
getTop
Description:
Get the top position of the viewport.

Parameters: none.
Return:
setPosition
Description:
Set the position.

Parameters:
NameTypeDescription
topfloatTop position of the viewport on the rendering window (between 0.0 and 1.0).
leftfloatLeft position of the viewport on the rendering window (between 0.0 and 1.0).

Return:
getWidth
Description:
Get the width of the viewport.

Parameters: none.
Return:
getHeight
Description:
Get the height of the viewport.

Parameters: none.
Return:
setSize
Description:
Set the size.

Parameters:
NameTypeDescription
widthfloatWidth of the viewport on the rendering window (between 0.0 and 1.0).
heightfloatHeight of the viewport on the rendering window (between 0.0 and 1.0).

Return:
setBackgroundColor
Description:
Set the background color.

Parameters:
NameTypeDescription
redfloatRed component of the background color (between 0.0 and 1.0).
greenfloatGreen component of the background color (between 0.0 and 1.0).
bluefloatBlue component of the background color (between 0.0 and 1.0).

Return:
setCamera
Description:
Set the camera.

Parameters:
NameTypeDescription
camera_namestringName of the camera.

Return:

Camera

Return to top.

Description:
A camera.
constructor
Description:
Camera cannot be instanciated by a script.
getName
Description:
Get the name of the camera.

Parameters: none.
Return:
getNearClipDistance
Description:
Get the near clip distance of the camera.

Parameters: none.
Return:
setNearClipDistance
Description:
Set the near clip distance of the camera.

Parameters:
NameTypeDescription
distancefloatNew falue for the near clip distance of the camera.

Return:
getFarClipDistance
Description:
Get the far clip distance of the camera.

Parameters: none.
Return:
setFarClipDistance
Description:
Set the far clip distance of the camera.

Parameters:
NameTypeDescription
distancefloatNew falue for the far clip distance of the camera.

Return:
getAspectRatio
Description:
Get the aspect ratio of the camera.

Parameters: none.
Return:
setAspectRatio
Description:
Set the aspect ratio of the camera.

Parameters:
NameTypeDescription
aspect_ratiofloatNew falue for the aspect ratio of the camera.

Return:
getVerticalFOV
Description:
Get the vertical field-of-view (in degrees) of the camera.

Parameters: none.
Return:
setVerticalFOV
Description:
Set the vertical field-of-view (in degrees) of the camera.

Parameters:
NameTypeDescription
fovfloatNew falue for the vertical field-of-view (in degrees) of the camera.

Return:
getPhysicsState
Description:
Get the physics state of the camera.

Parameters: none.
Return:
getPhysicsMass
Description:
Get the physics mass of the camera.

Parameters: none.
Return:
getPhysicsRadius
Description:
Get the physics radius (in meters) of the camera.

Parameters: none.
Return:
setPhysicsProperties
Description:
Set the physics properties.

Parameters:
NameTypeDescription
stateboolPhysics state (true to enable physics on actor, false otherwise).
massfloatPhysics mass of the camera.
radiusfloatPhysics radius of the camera (in meters).

Return: