Lua functions list

From MaratisWiki
(Difference between revisions)
Jump to: navigation, search
m
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
====Object====
+
__NOTOC__
  
getObject(« objectName »)<br/>
+
<onlyinclude>
rotate(object, {x, y, z}, angle, « local »)<br/>
+
{{column-box-begin}}
translate(object, {x, y, z}, « local »)<br/>
+
getPosition(object)<br/>
+
getRotation(object)<br/>
+
getScale(object)<br/>
+
setPosition(object, {x, y, z})<br/>
+
setRotation(object, {x, y, z})<br/>
+
setScale(object, {x, y, z})<br/>
+
isVisible(object)<br/>
+
activate(object)<br/>
+
deactivate(object)<br/>
+
  
====Behavior====
+
{{begin-box|3D Math}}
 +
* <code>'''[[vec3]](x, y, z)'''</code>
 +
* <code>'''[[length]](vec3)'''</code>
 +
* <code>'''[[normalize]](vec3)'''</code>
 +
* <code>'''[[dot]](vecA, vecB)'''</code>
 +
* <code>'''[[cross]](vecA, vecB)'''</code>
 +
{{end-box}}
  
getBehaviorVariable(object, behaviorId, « variableName »)<br/>
+
{{begin-box|Input}}
setBehaviorVariable(object, behaviorId, « variableName », value)<br/>
+
* <code>'''[[isKeyPressed]]([[Keys|key]])'''</code>
 +
* <code>'''[[onKeyDown]]([[Keys|key]])'''</code>
 +
* <code>'''[[onKeyUp]]([[Keys|key]])'''</code>
 +
* <code>'''[[getAxis]]([[Axis|axis]])'''</code>
 +
* <code>'''[[getProperty]]("propertyName")'''</code>
 +
* <code>'''[[getTouchPosition]](touchId)'''</code>
 +
* <code>'''[[getLastTouchPosition]](touchId)'''</code>
 +
* <code>'''[[getTouchPhase]](touchId)'''</code>
 +
{{end-box}}
  
====Animation====
+
{{begin-box|Scene}}
 +
* <code>'''[[getScene]]("sceneName")'''</code>
 +
* <code>'''[[changeScene]](scene)'''</code>
 +
* <code>'''[[getCurrentSceneId]]()'''</code>
 +
* <code>'''[[getScenesNumber]]()'''</code>
 +
{{end-box}}
  
getCurrentAnimation(object)<br/>
+
{{begin-box|Level}}
changeAnimation(object, animationId)<br/>
+
* <code>'''[[loadLevel]]("levelName")'''</code>
isAnimationOver(object)<br/>
+
{{end-box}}
  
====Physics====
+
{{begin-box|System}}
 +
* <code>'''[[centerCursor]]()'''</code>
 +
* <code>'''[[hideCursor]]()'''</code>
 +
* <code>'''[[showCursor]]()'''</code>
 +
* <code>'''[[getWindowScale]]()'''</code>
 +
* <code>'''[[getSystemTick]]()'''</code>
 +
* <code>'''[[quit]]()'''</code>
 +
* <code>'''[[dofile]]("filename.lua")'''</code>
 +
{{end-box}}
  
setGravity({x, y, z})<br/>
+
{{begin-box|Animation}}
getGravity()<br/>
+
* <code>'''[[getCurrentAnimation]](object)'''</code>
addCentralForce(object, {x, y, z}, « local »)<br/>
+
* <code>'''[[changeAnimation]](object, animationId)'''</code>
addTorque(object, {x, y, z}, « local »)<br/>
+
* <code>'''[[isAnimationOver]](object)'''</code>
getLinearDamping(object)<br/>
+
* <code>'''[[getAnimationSpeed]](object)'''</code>
setLinearDamping(object, {x, y, z})<br/>
+
* <code>'''[[setAnimationSpeed]](object, speed)'''</code>
getAngularDamping(object)<br/>
+
* <code>'''[[getCurrentFrame]](object)'''</code>
setAngularDamping(object, damping)<br/>
+
* <code>'''[[setCurrentFrame]](object, frame)'''</code>
isCollisionTest(object)<br/>
+
{{end-box}}
isCollisionBetween(object1, object2)<br/>
+
clearForces(object)<br/>
+
getNumCollisions(object)<br/>
+
  
====Inputs====
+
{{begin-box|Sound}}
 +
* <code>'''[[playSound]](object)'''</code>
 +
* <code>'''[[pauseSound]](object)'''</code>
 +
* <code>'''[[stopSound]](object)'''</code>
 +
* <code>'''[[getSoundGain]](object)'''</code>
 +
* <code>'''[[setSoundGain]](object, gain)'''</code>
 +
{{end-box}}
  
isKeyPressed([[Keys|key]])<br/>
+
{{begin-box|Text}}
onKeyDown([[Keys|key]])<br/>
+
* <code>'''[[setText]](object , "text")'''</code>
onKeyUp([[Keys|key]])<br/>
+
* <code>'''[[getText]](object)'''</code>
getAxis([[Axis|axis]])<br/>
+
* <code>'''[[getTextColor]](object)'''</code>
 +
* <code>'''[[setTextColor]](object, {r, g, b, a})'''</code>
 +
{{end-box}}
  
====Sound====
+
{{begin-box|Camera}}
 +
* <code>'''[[changeCurrentCamera]](object)'''</code>
 +
* <code>'''[[getCurrentCamera]]()'''</code>
  
playSound(object)<br/>
+
* <code>'''[[getCameraClearColor]](object)'''</code>
pauseSound(object)<br/>
+
* <code>'''[[getCameraFov]](object)'''</code>
stopSound(object)<br/>
+
* <code>'''[[getCameraNear]](object)'''</code>
getSoundGain(object)<br/>
+
* <code>'''[[getCameraFar]](object)'''</code>
setSoundGain(object, gain)<br/>
+
* <code>'''[[getCameraFogDistance]](object)'''</code>
 +
* <code>'''[[isCameraOrtho]](object)'''</code>
 +
* <code>'''[[isCameraFogEnabled]](object)'''</code>
 +
* <code>'''[[setCameraClearColor]](object, {r, g, b})'''</code>
 +
* <code>'''[[setCameraFov]](object, fov)'''</code>
 +
* <code>'''[[setCameraNear]](object, near)'''</code>
 +
* <code>'''[[setCameraFar]](object, far)'''</code>
 +
* <code>'''[[setCameraFogDistance]](object, fogDistance)'''</code>
 +
* <code>'''[[enableCameraOrtho]](object, ortho)'''</code>
 +
* <code>'''[[enableCameraFog]](object, fog)'''</code>
 +
{{vspace}}
 +
* <code>'''[[enableCameraLayer]](object, scene)'''</code>
 +
* <code>'''[[disableCameraLayer]](object)'''</code>
 +
* <code>'''[[enableRenderToTexture]](object, "textureName", renderWith, renderHeight)'''</code>
 +
* <code>'''[[disableRenderToTexture]](object)'''</code>
 +
{{vspace}}
 +
* <code>'''[[getProjectedPoint]](object, point)'''</code>
 +
* <code>'''[[getUnProjectedPoint]](object, point)'''</code>
 +
{{end-box}}
  
====Scene====
+
{{column-box-breaker}}
  
changeScene(sceneId)<br/>
+
{{begin-box|Object}}
 +
* <code>'''[[getObject]]("objectName")'''</code>
 +
* <code>'''[[getParent]](object)'''</code>
 +
* <code>'''[[getChilds]](object)'''</code>
 +
* <code>'''[[getClone]](object)'''</code>
 +
* <code>'''[[setParent]](object, parent)'''</code>
 +
* <code>'''[[getName]](object)'''</code>
 +
* <code>'''[[activate]](object)'''</code>
 +
* <code>'''[[deactivate]](object)'''</code>
 +
* <code>'''[[isVisible]](object)'''</code>
 +
* <code>'''[[isActive]](object)'''</code>
 +
{{vspace}}
 +
* <code>'''[[enableShadow]](object, shadow)'''</code>
 +
* <code>'''[[isCastingShadow]](object)'''</code>
 +
{{end-box}}
  
====Level====
+
{{begin-box|Transformation}}
 +
* <code>'''[[rotate]](object, {x, y, z}, angle, ''"local"'')'''</code>
 +
* <code>'''[[translate]](object, {x, y, z}, ''"local"'')'''</code>
 +
{{vspace}}
 +
* <code>'''[[getPosition]](object)'''</code>
 +
* <code>'''[[getRotation]](object)'''</code>
 +
* <code>'''[[getScale]](object)'''</code>
 +
* <code>'''[[setPosition]](object, {x, y, z})'''</code>
 +
* <code>'''[[setRotation]](object, {x, y, z})'''</code>
 +
* <code>'''[[setScale]](object, {x, y, z})'''</code>
 +
{{vspace}}
 +
* <code>'''[[getTransformedPosition]](object)'''</code>
 +
* <code>'''[[getTransformedRotation]](object)'''</code>
 +
* <code>'''[[getTransformedScale]](object)'''</code>
 +
* <code>'''[[getInverseRotatedVector]](object)'''</code>
 +
* <code>'''[[getRotatedVector]](object)'''</code>
 +
* <code>'''[[getInverseVector]](object)'''</code>
 +
* <code>'''[[getTransformedVector]](object)'''</code>
 +
{{vspace}}
 +
* <code>'''[[updateMatrix]](object)'''</code>
 +
* <code>'''[[getMatrix]](object)'''</code>
 +
{{end-box}}
  
loadLevel(« levelName »)<br/>
+
{{begin-box|Behavior}}
 +
* <code>'''[[getBehaviorVariable]](object, behaviorId, "variableName")'''</code>
 +
* <code>'''[[setBehaviorVariable]](object, behaviorId, "variableName", value)'''</code>
 +
{{end-box}}
  
====Light====
+
{{begin-box|Physics}}
 +
* <code>'''[[setGravity]]({x, y, z})'''</code>
 +
* <code>'''[[getGravity]]()'''</code><br><br>
 +
* <code>'''[[getLinearDamping]](object)'''</code>
 +
* <code>'''[[setLinearDamping]](object, damping)'''</code>
 +
* <code>'''[[getAngularDamping]](object)'''</code>
 +
* <code>'''[[setAngularDamping]](object, damping)'''</code>
 +
* <code>'''[[getLinearFactor]](object)'''</code>
 +
* <code>'''[[setLinearFactor]](object, {x, y, z})'''</code>
 +
* <code>'''[[getAngularFactor]](object)'''</code>
 +
* <code>'''[[setAngularFactor]](object, factor)'''</code>
 +
* <code>'''[[getMass]](object)'''</code>
 +
* <code>'''[[setMass]](object, mass)'''</code>
 +
* <code>'''[[getFriction]](object)'''</code>
 +
* <code>'''[[setFriction]](object, friction)'''</code>
 +
* <code>'''[[getRestitution]](object)'''</code>
 +
* <code>'''[[setRestitution]](object, restitution)'''</code>
 +
{{vspace}}
 +
* <code>'''[[clearForces]](object)'''</code>
 +
* <code>'''[[addCentralForce]](object, {x, y, z}, ''"local"'')'''</code>
 +
* <code>'''[[addTorque]](object, {x, y, z}, ''"local"'')'''</code>
 +
* <code>'''[[getCentralForce]](object)'''</code>
 +
* <code>'''[[getTorque]](object)'''</code>
 +
* <code>'''[[isCollisionTest]](object)'''</code>
 +
* <code>'''[[isCollisionBetween]](object1, object2)'''</code>
 +
* <code>'''[[getNumCollisions]](object)'''</code>
 +
* <code>'''[[rayHit]](start, end)'''</code>
 +
{{end-box}}
  
getLightColor(object)<br/>
+
{{begin-box|Light}}
getLightRadius(object)<br/>
+
* <code>'''[[getLightColor]](object)'''</code>
getLightIntensity(object)<br/>
+
* <code>'''[[getLightRadius]](object)'''</code>
setLightColor(object, {r, g, b})<br/>
+
* <code>'''[[getLightIntensity]](object)'''</code>
setLightRadius(object, radius)<br/>
+
* <code>'''[[getLightShadowQuality]](object)'''</code>
setLightIntensity(object, intensity)<br/>
+
* <code>'''[[getLightShadowBias]](object)'''</code>
 +
* <code>'''[[getLightShadowBlur]](object)'''</code>
 +
* <code>'''[[getLightSpotAngle]](object)'''</code>
 +
* <code>'''[[getLightSpotExponent]](object)'''</code>
 +
* <code>'''[[setLightColor]](object, {r, g, b})'''</code>
 +
* <code>'''[[setLightRadius]](object, radius)'''</code>
 +
* <code>'''[[setLightIntensity]](object, intensity)'''</code>
 +
* <code>'''[[setLightShadowQuality]](object, quality)'''</code>
 +
* <code>'''[[setLightShadowBias]](object, bias)'''</code>
 +
* <code>'''[[setLightShadowBlur]](object, blur)'''</code>
 +
* <code>'''[[setLightSpotAngle]](object, spotAngle)'''</code>
 +
* <code>'''[[setLightSpotExponent]](object, exponent)'''</code>
 +
{{end-box}}
  
====Camera====
+
{{column-box-end}}
 +
</onlyinclude>
  
changeCurrentCamera(object)<br/>
+
[[Category:Lua scripting]]
getCameraClearColor(object)<br/>
+
getCameraFov(object)<br/>
+
getCameraNear(object)<br/>
+
getCameraFar(object)<br/>
+
getCameraFogDistance(object)<br/>
+
isCameraOrtho(object)<br/>
+
isCameraFogEnabled(object)<br/>
+
setCameraClearColor(object, {r, g, b})<br/>
+
setCameraFov(object, fov)<br/>
+
setCameraNear(object, near)<br/>
+
setCameraFar(object, far)<br/>
+
setCameraFogDistance(object, fogDistance)<br/>
+
enableCameraOrtho(object, ortho)<br/>
+
enableCameraFog(object, fog)<br/>
+
 
+
====Text====
+
 
+
setText(object , « text »)<br/>
+
getText(object)<br/>
+
getTextColor(object)<br/>
+
setTextColor(object, {r, g, b, a})<br/>
+
 
+
====Cursor====
+
 
+
centerCursor()<br/>
+

Latest revision as of 01:08, 9 February 2014


3D Math

Input

Scene

Level

System

Animation

Sound

Text

Camera

Object

Transformation

  • rotate(object, {x, y, z}, angle, "local")
  • translate(object, {x, y, z}, "local")

Behavior

Physics

Light

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox