Lua functions list
(Difference between revisions)
(→System) |
|||
Line 1: | Line 1: | ||
+ | ===3d Math=== | ||
+ | |||
+ | * [[vec3]](x, y, z) | ||
+ | * [[length]](vec3) | ||
+ | * [[normalize]](vec3) | ||
+ | * [[dot]](vec3) | ||
+ | * [[cross]](vec3)<br><br> | ||
===Object=== | ===Object=== | ||
* [[getObject]](« objectName ») | * [[getObject]](« objectName ») | ||
+ | * [[getParent]](object) | ||
+ | * [[getChilds]](object) | ||
* [[getClone]](object) | * [[getClone]](object) | ||
+ | * [[setParent]](object, parent) | ||
+ | * [[getName]](object) | ||
+ | * [[activate]](object) | ||
+ | * [[deactivate]](object) | ||
+ | * [[isVisible]](object) | ||
+ | * [[isActive]](object)<br><br> | ||
* [[rotate]](object, {x, y, z}, angle, ''"local"'') | * [[rotate]](object, {x, y, z}, angle, ''"local"'') | ||
* [[translate]](object, {x, y, z}, ''"local"'') | * [[translate]](object, {x, y, z}, ''"local"'') | ||
Line 10: | Line 25: | ||
* [[setPosition]](object, {x, y, z}) | * [[setPosition]](object, {x, y, z}) | ||
* [[setRotation]](object, {x, y, z}) | * [[setRotation]](object, {x, y, z}) | ||
− | * [[setScale]](object, {x, y, z}) | + | * [[setScale]](object, {x, y, z})<br><br> |
− | * [[ | + | * [[getTransformedPosition]](object) |
− | * [[ | + | * [[getTransformedRotation]](object) |
− | * [[ | + | * [[getTransformedScale]](object) |
− | + | * [[getInverseRotatedVector]](object) | |
+ | * [[getRotatedVector]](object) | ||
+ | * [[getInverseVector]](object) | ||
+ | * [[getTransformedVector]](object) | ||
+ | * [[updateMatrix]](object) | ||
+ | * [[getMatrix]](object)<br><br> | ||
+ | * [[enableShadow]](object, shadow) | ||
+ | * [[isCastingShadow]](object)<br><br> | ||
===Behavior=== | ===Behavior=== | ||
* [[getBehaviorVariable]](object, behaviorId, "variableName") | * [[getBehaviorVariable]](object, behaviorId, "variableName") | ||
− | * [[setBehaviorVariable]](object, behaviorId, "variableName", value) | + | * [[setBehaviorVariable]](object, behaviorId, "variableName", value)<br><br> |
− | + | ||
===Animation=== | ===Animation=== | ||
Line 25: | Line 46: | ||
* [[changeAnimation]](object, animationId) | * [[changeAnimation]](object, animationId) | ||
* [[isAnimationOver]](object) | * [[isAnimationOver]](object) | ||
− | + | * [[getAnimationSpeed]](object) | |
+ | * [[setAnimationSpeed]](object, speed) | ||
+ | * [[getCurrentFrame]](object) | ||
+ | * [[setCurrentFrame]](object, frame)<br><br> | ||
===Physics=== | ===Physics=== | ||
* [[setGravity]]({x, y, z}) | * [[setGravity]]({x, y, z}) | ||
− | * [[getGravity]]() | + | * [[getGravity]]()<br><br> |
− | + | ||
− | + | ||
* [[getLinearDamping]](object) | * [[getLinearDamping]](object) | ||
− | * [[setLinearDamping]](object, | + | * [[setLinearDamping]](object, damping) |
* [[getAngularDamping]](object) | * [[getAngularDamping]](object) | ||
* [[setAngularDamping]](object, damping) | * [[setAngularDamping]](object, damping) | ||
+ | * [[getLinearFactor]](object) | ||
+ | * [[setLinearFactor]](object, {x, y, z}) | ||
+ | * [[getAngularFactor]](object) | ||
+ | * [[setAngularFactor]](object, factor) | ||
+ | * [[getMass]](object) | ||
+ | * [[setMass]](object, mass) | ||
+ | * [[getFriction]](object) | ||
+ | * [[setFriction]](object, friction) | ||
+ | * [[getRestitution]](object) | ||
+ | * [[setRestitution]](object, restitution)<br><br> | ||
+ | * [[clearForces]](object) | ||
+ | * [[addCentralForce]](object, {x, y, z}, ''"local"'') | ||
+ | * [[addTorque]](object, {x, y, z}, ''"local"'') | ||
+ | * [[getCentralForce]](object) | ||
+ | * [[getTorque]](object) | ||
* [[isCollisionTest]](object) | * [[isCollisionTest]](object) | ||
* [[isCollisionBetween]](object1, object2) | * [[isCollisionBetween]](object1, object2) | ||
− | |||
* [[getNumCollisions]](object) | * [[getNumCollisions]](object) | ||
− | * [[rayHit]](start, end, ''object'') | + | * [[rayHit]](start, end, ''object'')<br><br> |
− | + | ||
===Inputs=== | ===Inputs=== | ||
Line 48: | Line 83: | ||
* [[onKeyUp]]([[Keys|key]]) | * [[onKeyUp]]([[Keys|key]]) | ||
* [[getAxis]]([[Axis|axis]]) | * [[getAxis]]([[Axis|axis]]) | ||
− | + | * [[getProperty]]("propertyName") | |
+ | * [[getTouchPosition]](touchId) | ||
+ | * [[getLastTouchPosition]](touchId) | ||
+ | * [[getTouchPhase]](touchId)<br><br> | ||
===Sound=== | ===Sound=== | ||
Line 55: | Line 93: | ||
* [[stopSound]](object) | * [[stopSound]](object) | ||
* [[getSoundGain]](object) | * [[getSoundGain]](object) | ||
− | * [[setSoundGain]](object, gain) | + | * [[setSoundGain]](object, gain)<br><br> |
− | + | ||
===Scene=== | ===Scene=== | ||
* [[getScene]]("sceneName") | * [[getScene]]("sceneName") | ||
* [[changeScene]](scene) | * [[changeScene]](scene) | ||
− | + | * [[getCurrentSceneId]]() | |
+ | * [[getScenesNumber]]()<br><br> | ||
===Level=== | ===Level=== | ||
− | * [[loadLevel]]("levelName") | + | * [[loadLevel]]("levelName")<br><br> |
− | + | ||
===Light=== | ===Light=== | ||
Line 71: | Line 108: | ||
* [[getLightRadius]](object) | * [[getLightRadius]](object) | ||
* [[getLightIntensity]](object) | * [[getLightIntensity]](object) | ||
+ | * [[getLightShadowQuality]](object) | ||
+ | * [[getLightShadowBias]](object) | ||
+ | * [[getLightShadowBlur]](object) | ||
+ | * [[getLightSpotAngle]](object) | ||
+ | * [[getLightSpotExponent]](object) | ||
* [[setLightColor]](object, {r, g, b}) | * [[setLightColor]](object, {r, g, b}) | ||
* [[setLightRadius]](object, radius) | * [[setLightRadius]](object, radius) | ||
* [[setLightIntensity]](object, intensity) | * [[setLightIntensity]](object, intensity) | ||
− | + | * [[setLightShadowQuality]](object, quality) | |
+ | * [[setLightShadowBias]](object, bias) | ||
+ | * [[setLightShadowBlur]](object, blur) | ||
+ | * [[setLightSpotAngle]](object, spotAngle) | ||
+ | * [[setLightSpotExponent]](object, exponent)<br><br> | ||
===Camera=== | ===Camera=== | ||
* [[changeCurrentCamera]](object) | * [[changeCurrentCamera]](object) | ||
+ | * [[getCurrentCamera]]()<br><br> | ||
* [[getCameraClearColor]](object) | * [[getCameraClearColor]](object) | ||
* [[getCameraFov]](object) | * [[getCameraFov]](object) | ||
Line 91: | Line 138: | ||
* [[setCameraFogDistance]](object, fogDistance) | * [[setCameraFogDistance]](object, fogDistance) | ||
* [[enableCameraOrtho]](object, ortho) | * [[enableCameraOrtho]](object, ortho) | ||
− | * [[enableCameraFog]](object, fog) | + | * [[enableCameraFog]](object, fog)<br><br> |
* [[enableCameraLayer]](object, scene) | * [[enableCameraLayer]](object, scene) | ||
* [[disableCameraLayer]](object) | * [[disableCameraLayer]](object) | ||
* [[enableRenderToTexture]](object, "textureName", renderWith, renderHeight) | * [[enableRenderToTexture]](object, "textureName", renderWith, renderHeight) | ||
− | * [[disableRenderToTexture]](object) | + | * [[disableRenderToTexture]](object)<br><br> |
− | + | * [[getProjectedPoint]](object, point) | |
+ | * [[getUnProjectedPoint]](object, point)<br><br> | ||
===Text=== | ===Text=== | ||
Line 102: | Line 150: | ||
* [[getText]](object) | * [[getText]](object) | ||
* [[getTextColor]](object) | * [[getTextColor]](object) | ||
− | * [[setTextColor]](object, {r, g, b, a}) | + | * [[setTextColor]](object, {r, g, b, a})<br><br> |
− | + | ||
===System=== | ===System=== | ||
Line 109: | Line 156: | ||
* [[hideCursor]]() | * [[hideCursor]]() | ||
* [[showCursor]]() | * [[showCursor]]() | ||
+ | * [[getWindowScale]]() | ||
+ | * [[getSystemTick]]() | ||
* [[quit]]() | * [[quit]]() | ||
* [[dofile]]("filename.lua") | * [[dofile]]("filename.lua") |
Revision as of 14:35, 5 February 2013
Contents |
3d Math
Object
- getObject(« objectName »)
- getParent(object)
- getChilds(object)
- getClone(object)
- setParent(object, parent)
- getName(object)
- activate(object)
- deactivate(object)
- isVisible(object)
- isActive(object)
- 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})
- getTransformedPosition(object)
- getTransformedRotation(object)
- getTransformedScale(object)
- getInverseRotatedVector(object)
- getRotatedVector(object)
- getInverseVector(object)
- getTransformedVector(object)
- updateMatrix(object)
- getMatrix(object)
- enableShadow(object, shadow)
- isCastingShadow(object)
Behavior
- getBehaviorVariable(object, behaviorId, "variableName")
- setBehaviorVariable(object, behaviorId, "variableName", value)
Animation
- getCurrentAnimation(object)
- changeAnimation(object, animationId)
- isAnimationOver(object)
- getAnimationSpeed(object)
- setAnimationSpeed(object, speed)
- getCurrentFrame(object)
- setCurrentFrame(object, frame)
Physics
- setGravity({x, y, z})
- getGravity()
- getLinearDamping(object)
- setLinearDamping(object, damping)
- getAngularDamping(object)
- setAngularDamping(object, damping)
- getLinearFactor(object)
- setLinearFactor(object, {x, y, z})
- getAngularFactor(object)
- setAngularFactor(object, factor)
- getMass(object)
- setMass(object, mass)
- getFriction(object)
- setFriction(object, friction)
- getRestitution(object)
- setRestitution(object, restitution)
- clearForces(object)
- addCentralForce(object, {x, y, z}, "local")
- addTorque(object, {x, y, z}, "local")
- getCentralForce(object)
- getTorque(object)
- isCollisionTest(object)
- isCollisionBetween(object1, object2)
- getNumCollisions(object)
- rayHit(start, end, object)
Inputs
- isKeyPressed(key)
- onKeyDown(key)
- onKeyUp(key)
- getAxis(axis)
- getProperty("propertyName")
- getTouchPosition(touchId)
- getLastTouchPosition(touchId)
- getTouchPhase(touchId)
Sound
- playSound(object)
- pauseSound(object)
- stopSound(object)
- getSoundGain(object)
- setSoundGain(object, gain)
Scene
- getScene("sceneName")
- changeScene(scene)
- getCurrentSceneId()
- getScenesNumber()
Level
- loadLevel("levelName")
Light
- getLightColor(object)
- getLightRadius(object)
- getLightIntensity(object)
- getLightShadowQuality(object)
- getLightShadowBias(object)
- getLightShadowBlur(object)
- getLightSpotAngle(object)
- getLightSpotExponent(object)
- setLightColor(object, {r, g, b})
- setLightRadius(object, radius)
- setLightIntensity(object, intensity)
- setLightShadowQuality(object, quality)
- setLightShadowBias(object, bias)
- setLightShadowBlur(object, blur)
- setLightSpotAngle(object, spotAngle)
- setLightSpotExponent(object, exponent)
Camera
- changeCurrentCamera(object)
- getCurrentCamera()
- 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)
- enableCameraLayer(object, scene)
- disableCameraLayer(object)
- enableRenderToTexture(object, "textureName", renderWith, renderHeight)
- disableRenderToTexture(object)
- getProjectedPoint(object, point)
- getUnProjectedPoint(object, point)
Text
- setText(object , "text")
- getText(object)
- getTextColor(object)
- setTextColor(object, {r, g, b, a})
System
- centerCursor()
- hideCursor()
- showCursor()
- getWindowScale()
- getSystemTick()
- quit()
- dofile("filename.lua")