Lua scripting

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
[[Lua functions list]]
 
[[Lua functions list]]
[[Lua keys]]
+
 
[[Lua axis]]
+
[[keys]]
 +
 
 +
[[axis]]
  
  

Revision as of 18:48, 8 April 2012

Lua functions list

keys

axis


Contents

Language :

Lua : http://www.lua.org


Functions list :

Object

getObject(« objectName »)
rotate(object, {x, y, z}, angle, « local »)
translate(object, {x, y, z}, « local »)
getPosition(object)
getRotation(object)
getScale(object)
setPosition(object, {x, y, z})
setRotation(object, {x, y, z})
setScale(object, {x, y, z})
isVisible(object)
activate(object)
deactivate(object)

Behavior

getBehaviorVariable(object, behaviorId, « variableName »)
setBehaviorVariable(object, behaviorId, « variableName », value)

Animation

getCurrentAnimation(object)
changeAnimation(object, animationId)
isAnimationOver(object)

Physics

setGravity({x, y, z})
getGravity()
addCentralForce(object, {x, y, z}, « local »)
addTorque(object, {x, y, z}, « local »)
getLinearDamping(object)
setLinearDamping(object, {x, y, z})
getAngularDamping(object)
setAngularDamping(object, damping)
isCollisionTest(object)
isCollisionBetween(object1, object2)
clearForces(object)
getNumCollisions(object)

Inputs

isKeyPressed(« key »)
onKeyDown(« key »)
onKeyUp(« key »)
getAxis(« axis »)

Sound

playSound(object)
pauseSound(object)
stopSound(object)
getSoundGain(object)
setSoundGain(object, gain)

Scene

changeScene(sceneId)

Level

loadLevel(« levelName »)

Light

getLightColor(object)
getLightRadius(object)
getLightIntensity(object)
setLightColor(object, {r, g, b})
setLightRadius(object, radius)
setLightIntensity(object, intensity)

Camera

changeCurrentCamera(object)
getCameraClearColor(object)
getCameraFov(object)
getCameraNear(object)
getCameraFar(object)
getCameraFogDistance(object)
isCameraOrtho(object)
isCameraFogEnabled(object)
setCameraClearColor(object, {r, g, b})
setCameraFov(object, fov)
setCameraNear(object, near)
setCameraFar(object, far)
setCameraFogDistance(object, fogDistance)
enableCameraOrtho(object, ortho)
enableCameraFog(object, fog)

Text

setText(object , « text »)
getText(object)
getTextColor(object)
setTextColor(object, {r, g, b, a})

Cursor

centerCursor()


Keys :

Keyboard

"A" to "Z"
"0″ to "9"
"F1" to "F12"
« BACKSPACE »
« TAB »
« ESCAPE »
« SPACE »
« DELETE »
« ENTER »
« UP »
« DOWN »
« LEFT »
« RIGHT »
« RSHIFT »
« LSHIFT »
« RCONTROL »
« LCONTROL »
« RALT »
« LALT »

Mouse

« MOUSE_BUTTON1″
« MOUSE_BUTTON2″
« MOUSE_BUTTON3″

Joystick 1

« JOY1_BUTTON1″
« JOY1_BUTTON2″
« JOY1_BUTTON3″
« JOY1_BUTTON4″
« JOY1_BUTTON5″
« JOY1_BUTTON6″
« JOY1_BUTTON7″
« JOY1_BUTTON8″

Joystick 2

« JOY2_BUTTON1″
« JOY2_BUTTON2″
« JOY2_BUTTON3″
« JOY2_BUTTON4″
« JOY2_BUTTON5″
« JOY2_BUTTON6″
« JOY2_BUTTON7″
« JOY2_BUTTON8″


Axis :

Mouse

« MOUSE_X »
« MOUSE_Y »

Joystick 1

« JOY1_X »
« JOY1_Y »
« JOY1_Z »
« JOY1_R »
« JOY1_U »
« JOY1_V »

Joystick 2

« JOY2_X »
« JOY2_Y »
« JOY2_Z »
« JOY2_R »
« JOY2_U »
« JOY2_V »

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox