Skip to content

Lua functions

Seth Hope edited this page Mar 21, 2015 · 2 revisions
<TITLE></TITLE> <STYLE TYPE="text/css"> </STYLE>

Funcitons

CLASS

	</TD>
	<TD WIDTH=33%>

FUNCTION

	</TD>
	<TD WIDTH=33%>

DESCRIPTION

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

Globals

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

System_run(string filename, SCENE MainScene)

	</TD>
	<TD WIDTH=33%>

Runs the selected script under the current lua_State. Used for loading in function definitions and lua apis.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

SCENE

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:load(string filename)

	</TD>
	<TD WIDTH=33%>

Loads (filename) into current scene

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:save(string filename)

	</TD>
	<TD WIDTH=33%>

Saves current scene to (filename)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:Objects()

	</TD>
	<TD WIDTH=33%>

Returns the amount of objects in the current scene

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:RenderEffect(number effectID)

	</TD>
	<TD WIDTH=33%>

Renders (effectID) effect from “Scripts/EffectsConfig/effect.xml”

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:deltaTime()

	</TD>
	<TD WIDTH=33%>

Returns the deltaTime

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:SLog(string info)

	</TD>
	<TD WIDTH=33%>

prints (info) to the log

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:SNLog(string info, number data)

	</TD>
	<TD WIDTH=33%>

prints "info : data" to log

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:SSLog(string info, string data)

	</TD>
	<TD WIDTH=33%>

prints "info : data" to log

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setDebug(number level(0-3))

	</TD>
	<TD WIDTH=33%>

sets the level of debug to (level)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setPhysicsDebug(number on(0 or 1))

	</TD>
	<TD WIDTH=33%>

Toggles physics debug

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addMesh(string filename, number x, number y, number z,  number rotx, number roty, number rotz, number scalex, number scaley, number scalez)

	</TD>
	<TD WIDTH=33%>

Adds mesh (filename) to the scene at the set pos, rot, and scale. Returns mesh ID.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getMesh(number id)

	</TD>
	<TD WIDTH=33%>

returns Mesh at (id)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addAnimatedMesh({SAME ARGUMENTS AS Scene:addMesh})

	</TD>
	<TD WIDTH=33%>

Adds animated mesh (filename) to the scene set pos, rot, scale. Returns AnimatedMesh ID.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getAnimatedMesh(number id)

	</TD>
	<TD WIDTH=33%>

returns AnimatedMesh at (id)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addParticle(number x, number y, number z, number xdir, number ydir, number zdir, number xscale, number yscale, number zscale, string filename)

	</TD>
	<TD WIDTH=33%>

 Adds a particle system at (x, y, z) facing (xdir, ydir, zdir), with scale (xscale, yscale, zscale), using (filename) as the particle sprite. Returns ParticleSystem ID.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addEmpty(number x, number y, number z, number xrot, number yrot, number zrot, number xscale, number yscale, number zscale)

	</TD>
	<TD WIDTH=33%>

Adds an empty object at set location, rotation, and scale. Returns emptyobject id.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getEmpty(number id)

	</TD>
	<TD WIDTH=33%>

returns EmptyObject at (id)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addCamera(number type(0-2))

	</TD>
	<TD WIDTH=33%>

Adds a camera to the scene. TYPES: 1 = FPS camera, 2 = FREE camera, 3 = MAYA STYLE Focus camera

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getCamera()

	</TD>
	<TD WIDTH=33%>

Returns the active camera

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addSound(string filename, number x, number y, number z, number loop(1 or 0))

	</TD>
	<TD WIDTH=33%>

adds and plays sound (filename)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getSound(number id)

	</TD>
	<TD WIDTH=33%>

returns sound (id)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getKey(number EKEY_CODE)

	</TD>
	<TD WIDTH=33%>

Returns whether the key is depressed or not. For a list of key codes, look at the Irrlicht 1.8 documentation.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:createCharacter(number height, number width, number stairheight)

	</TD>
	<TD WIDTH=33%>

Creates a character physics controller of (height, width) and can climb stairs of height (stairheight)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:modifyCharacter(string function, ...data...)

	</TD>
	<TD WIDTH=33%>

Modifies character data. Check table below for character funcitons.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getCharacterData(string function)

	</TD>
	<TD WIDTH=33%>

returns character data at (function). Check table below for character datapoints

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:moveCharacter(number x, number y, number z, number camdirx, number camdiry,  number camdirz, number speed)

	</TD>
	<TD WIDTH=33%>

 Moves player in respect to the camera with multiplier (speed).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setSkydome(string filename)

	</TD>
	<TD WIDTH=33%>

Sets the skydome image.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:removeObject(number id)

	</TD>
	<TD WIDTH=33%>

removes object (id)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setTimeScale(number timescale (defaults to 0.004))

	</TD>
	<TD WIDTH=33%>

sets the physics timescale. Useful for faster or slower physics.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getTimeScale()

	</TD>
	<TD WIDTH=33%>

returns the current physics timescale.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getMouseButton()

	</TD>
	<TD WIDTH=33%>

Returns the clicked mouse button

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getMousePosition()

	</TD>
	<TD WIDTH=33%>

Returns X, Y mouse position

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addWindow(string title, x1, y1, x2, y2, GUI parent, string scriptFilename)

	</TD>
	<TD WIDTH=33%>

Adds a window with (title) at (x1, y1) (x2, y2). Runs “onClose()” function in (scriptFilename) when the window is closed.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addSlider(number horizontal (0-1), number x1, number y1, number x2, number y2, number parentID, string scriptFilename)

	</TD>
	<TD WIDTH=33%>

Adds a slider at (x1, y1, x2, y2). Runs “onScroll(number pos)” function within (scriptFilename). Returns the ID of the gui object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addButton(string title, string mouseover, number x1, number y1, number x2, number y2, number parentID, string scriptFilename)

	</TD>
	<TD WIDTH=33%>

Adds a button with text (title) and mouseover text of (mouseover) at (x1, y1, x2, y2). Runs the "onClick()" function in the script at (scriptFilename). Returns the ID of the gui object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addEditBox(string defaultText, number x1, number y1, number x2, number y2, number border (0-1), number parentID, string scriptFilename)

	</TD>
	<TD WIDTH=33%>

Adds a text edit box at (x1, y1, x2, y2) with (defaultText) as it's starting value and a border if (border) is '1'. (scriptFilename) must contain the functions: “onEnter(string text)” which runs when text is submitted, “onChange()” which runs when the text is changed, and “onMarkChange()” when the highlighted region is changed. Returns the ID of the GUI object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addText(string text, number x1, number y1, number x2, number y2, number parentID)

	</TD>
	<TD WIDTH=33%>

Adds (text) at (x1, y1, x2, y2). Returns the ID of the GUI object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addListBox(number x1, number y1, number x2, number y2, number parentID, string scriptFilename)

	</TD>
	<TD WIDTH=33%>

Adds a list box at (x1, y1, x2, y2). Runs “onSelect(number selection)” in (scriptFilename) on selection.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addListItem(string itemName, number parentList)

	</TD>
	<TD WIDTH=33%>

Adds a list item named (itemName) to (parentList). Returns item ID within list.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:removeListItem(number listBox, number itemID)

	</TD>
	<TD WIDTH=33%>

Removes (itemID) from (listBox).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:addImage(number x1, number y1, number x2, number y2, string filename, number parentID)

	</TD>
	<TD WIDTH=33%>

Adds (filename) image to the GUI at (x1, y1, x2, y2). Returns the ID of the GUI object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:clearGUI()

	</TD>
	<TD WIDTH=33%>

Removes all GUI objects on screen.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setGUIColor(number r, number g, number b, number a)

	</TD>
	<TD WIDTH=33%>

Sets the color of the GUI to (r, g, b, a).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getGUIColor()

	</TD>
	<TD WIDTH=33%>

Returns (r, g, b, a).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setGUIFont(string filename)

	</TD>
	<TD WIDTH=33%>

Sets font to (filename). Accepts bitmap fonts.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getGUIObject(number guiID)

	</TD>
	<TD WIDTH=33%>

Returns the GUI object at (guiID)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setMetaData(string key, string data)

	</TD>
	<TD WIDTH=33%>

Sets (key) to (data).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getMetaData(string key)

	</TD>
	<TD WIDTH=33%>

Returns the data at (key)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:getMouseControl()

	</TD>
	<TD WIDTH=33%>

Disables mouse.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33% HEIGHT=22>

	</TD>
	<TD WIDTH=33%>

Scene:giveMouseControl()

	</TD>
	<TD WIDTH=33%>

Enables mouse control (useful for GUI functions).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Scene:setGravity(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets the gravity vector to (x, y, z).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

OBJECT

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:getCollider()

	</TD>
	<TD WIDTH=33%>

Returns the COLLIDER of the object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:getPosition()

	</TD>
	<TD WIDTH=33%>

Returns (x, y, z) position.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:getRotation()

	</TD>
	<TD WIDTH=33%>

Returns (x, y, z) rotation.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:getScale()

	</TD>
	<TD WIDTH=33%>

Returns (x, y, z) scale.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:setPosition(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets position of Object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:setRotation(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets rotation of Object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:setScale(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets scale of Object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:getName()

	</TD>
	<TD WIDTH=33%>

Returns name of object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:setName(string name)

	</TD>
	<TD WIDTH=33%>

Sets the name of Object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:getID()

	</TD>
	<TD WIDTH=33%>

Returns the ID of Object,.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:addScript(SCENE MainScene, string filename)

	</TD>
	<TD WIDTH=33%>

Attaches a script to an object. The script MUST contain a function "init" a funciton "update" and a function "render". If it lacks any of these, the program will fail to run.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:setMaterial(string materialType(see Material Types table))

	</TD>
	<TD WIDTH=33%>

Sets the material type of Object.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:setMaterialFlag(string flag(see Material Flags table), ...values...)

	</TD>
	<TD WIDTH=33%>

Sets the values of (flag).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:setMaterialTexture(SCENE MainScene, number texture, string filename)

	</TD>
	<TD WIDTH=33%>

Sets (texture) to (filename).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Object:attachTo(OBJECT o)

	</TD>
	<TD WIDTH=33%>

Attaches Object to (o).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

MESH

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Mesh:addCollider(SCENE MainScene, string type (see types chart), number mass)

	</TD>
	<TD WIDTH=33%>

Creates a collider on Mesh of (type) and (mass).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Mesh:toObject()

	</TD>
	<TD WIDTH=33%>

Returns the OBJECT type of Mesh.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

ANIMATED MESH

	</TD>
	<TD WIDTH=33%>

INHERITS ALL FUNCTIONS FROM MESH

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

AnimatedMesh:setFrameLoop(number first, number last)

	</TD>
	<TD WIDTH=33%>

Sets the animation frame range of the current animation.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

AnimatedMesh:setSpeed(number fps)

	</TD>
	<TD WIDTH=33%>

Sets the speed of the animation in Frames per Second.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

PARTICLE

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:setAge(number minAge, number maxAge)

	</TD>
	<TD WIDTH=33%>

Sets the minimum and maximum age of particles.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:setColors(number r1, number g1, number b1, number a1, number r2, number g2, number b2, number a2)

	</TD>
	<TD WIDTH=33%>

Sets the color tint of the particles as they progress through their age.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:setDirection(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets the direciton in which the particles are emitted.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:setRate(number minRate, number maxRate)

	</TD>
	<TD WIDTH=33%>

Sets the minimum and maximum rate of particle emissions.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:setSize(number minSize,  number maxSize)

	</TD>
	<TD WIDTH=33%>

Sets the minimum and maximum size of particles.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:addAffector(string affector (see affectors table))

	</TD>
	<TD WIDTH=33%>

Adds an affector to the current particle system.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:addCollider(SCENE MainScene, string type (see OBJECT collider types table), number mass)

	</TD>
	<TD WIDTH=33%>

Adds a collider to the particle system

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Particle:toObject()

	</TD>
	<TD WIDTH=33%>

Returns OBJECT type of Particle.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

SOUND

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:load(string filename, number x, number y, number z, number loop(0-1))

	</TD>
	<TD WIDTH=33%>

Loads sound (filename) and plays it at (x, y, z). If loop = 1, it will loop the track.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:stop()

	</TD>
	<TD WIDTH=33%>

Stops Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:isPlaying()

	</TD>
	<TD WIDTH=33%>

Returns 1 if Sound is playing. Returns 0 otherwise.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:setVolume(number volume)

	</TD>
	<TD WIDTH=33%>

Sets the volume of Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:setPosition(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets the position of the sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:setDropoff(number minDistance, number maxDistance)

	</TD>
	<TD WIDTH=33%>

Sets the dropoff of the sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:enableChorus(number wetDryMix, number depth, number feedback, number frequency)

	</TD>
	<TD WIDTH=33%>

Enables chorus effect on Sound

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:disableChorus()

	</TD>
	<TD WIDTH=33%>

Disables the chorus effect on Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:enableCompressor(number gain, number attack, number release)

	</TD>
	<TD WIDTH=33%>

Enables a compressor effect on Sound

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:disableCompressor()

	</TD>
	<TD WIDTH=33%>

Disables compressor effect on Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:enableDistortion(number gain, number edge, number PostEQCenterFreq, number PostEQBandwidth, number preLowPassCutoff)

	</TD>
	<TD WIDTH=33%>

Enables Distortion effect on Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:disableDistortion()

	</TD>
	<TD WIDTH=33%>

Disables distortion effect.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:enableEcho(number wetDryMix, number feedback, number leftDelay, number rightDelay, number PanDelay)

	</TD>
	<TD WIDTH=33%>

Enables Echo effect on Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:disableEcho()

	</TD>
	<TD WIDTH=33%>

Disables Echo Effect on Sound

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:enableReverb(number gain, number reverbMix, number reverbTime, number highFreqRTRatio)

	</TD>
	<TD WIDTH=33%>

Enables Reverb effect on Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Sound:disableReverb()

	</TD>
	<TD WIDTH=33%>

Disables Reverb effect on Sound.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

EMPTY OBJECT

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

EmptyObject:addCollider(SCENE MainScene, string type(see Object Collider Types table), number mass)

	</TD>
	<TD WIDTH=33%>

Adds a collider to the EmptyObject of (type) and (mass)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

EmptyObject:toObject()

	</TD>
	<TD WIDTH=33%>

Returns OBJECT type of EmptyObject.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

CAMERA

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setFOV(number fov)

	</TD>
	<TD WIDTH=33%>

Sets the Field of View of the camera.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:getFOV()

	</TD>
	<TD WIDTH=33%>

Returns the Field of View of the camera

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setClipping(number nearClipping, number farClipping)

	</TD>
	<TD WIDTH=33%>

Sets the near and far clipping distances.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:getClipping()

	</TD>
	<TD WIDTH=33%>

Returns (nearClipping, farClipping).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setTarget(OBJECT target)

	</TD>
	<TD WIDTH=33%>

Sets camera target to (target)

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setAspect(number ratio)

	</TD>
	<TD WIDTH=33%>

Sets the camera aspect ratio.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setOffset(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Adds an offset value to the camera's position. Useful for FPS camera.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setPosition(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets the camera position.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:getPosition()

	</TD>
	<TD WIDTH=33%>

Returns (x, y, z) camera position.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setRotation(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets the rotation of the camera to (x, y, z).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:attachTo(OBJECT o)

	</TD>
	<TD WIDTH=33%>

Attaches the camera to (o).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Camera:setUpVector(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets the upward vector of the camera to (x, y, z). Is (0, 1, 0) by default.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

LIGHT

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Light:setColor(number r, number g, number b, number a)

	</TD>
	<TD WIDTH=33%>

Sets the light color to (r, g, b, a).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Light:getColor()

	</TD>
	<TD WIDTH=33%>

Returns (r, g, b, a) of the light color.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Light:setDropoff(number dropoff)

	</TD>
	<TD WIDTH=33%>

Sets the dropoff of the light to (dropoff).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Light:setType(number type (0-2)

	</TD>
	<TD WIDTH=33%>

Sets the type of the light to (type). 0=Point light, 1=Spot Light, and 2=Directional.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

TERRAIN

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Terrain:empty(number sizeX, number sizeY)

	</TD>
	<TD WIDTH=33%>

Initializes a flat terrain of size (sizeX, sizeY).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Terrain:load(string filename)

	</TD>
	<TD WIDTH=33%>

Loads a terrain from a monochrome image (filename).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Terrain:getHeight(number x, number y)

	</TD>
	<TD WIDTH=33%>

Returns the height of the terrain at (x, y).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Terrain:setHeight(number x, number y, number height)

	</TD>
	<TD WIDTH=33%>

Sets the height at (x, y) to (height).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Terrain:getSizeX()

	</TD>
	<TD WIDTH=33%>

Returns the X width of the terrain.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Terrain:getSizeY()

	</TD>
	<TD WIDTH=33%>

Returns the Y width of the terrain.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Terrain:addCollider(SCENE MainScene, string type (see types chart), number mass)

	</TD>
	<TD WIDTH=33%>

Creates a collider on Terrain of (type) and (mass).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

COLLIDER

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:setVelocity(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets velocity of Collider.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:setAVelocity(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Sets angular velocity of Collider.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:setFriction(number friciton)

	</TD>
	<TD WIDTH=33%>

Sets the friction of Collider

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:setDamping(lDamping, aDamping)

	</TD>
	<TD WIDTH=33%>

Sets the linear and angular damping of Collider.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:setMass(number mass)

	</TD>
	<TD WIDTH=33%>

Sets the mass of Collider.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:setLocal(number local (0-1))

	</TD>
	<TD WIDTH=33%>

Sets the coordinates to local if (local) = 1. Relative if (local) = 0.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:addCentralForce(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Applies a force of (x, y, z) to the center of mass.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:addForce(number forceX, number forceY, number forceZ, number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Applies a force of (forceX, forceY, forceZ) to (x, y, z) position on Collider.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:addTorque(number x, number y, number z)

	</TD>
	<TD WIDTH=33%>

Adds torque of (x, y, z) to the collider.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

Collider:setState(string state)

	</TD>
	<TD WIDTH=33%>

Sets the state of the collider. Possible states are: “ACTIVE”, “NO_DEACTIVATION”, or “SLEEPING”.

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

GUI

	</TD>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

GUI:setText(string text)

	</TD>
	<TD WIDTH=33%>

Changes the text of the element to (text).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

GUI:setTitle(string text)

	</TD>
	<TD WIDTH=33%>

Changes the title of the element to (text).

	</TD>
</TR>
<TR VALIGN=TOP>
	<TD WIDTH=33%>

	</TD>
	<TD WIDTH=33%>

GUI:removeElement()

	</TD>
	<TD WIDTH=33%>

Removes current element.

	</TD>
</TR>
Character Functions
FUNCTION VALUES
jumpforce (number force)
jumpheight (number height)
maxslope (number slopeangle)
jump (none)
warp (number x, number y, number z)

 

Character Datapoints
Variables Returns
jump Returns 1 if player can jump
onGround Returns 1 if player is on the ground
maxslope Returns max slope angle
posX Returns X position of character
posY Returns Y position of character
posZ Returns Z position of character

 

Mesh Collider Types
Collider Types Description
CUBE a basic bounding box collider
SPHERE a basic Sphere collider
MESH_CONVEXHULL Used for small solid meshs
MESH_TRIMESH Used for large level meshes
MESH_GIMPACT A more responsive version of MESH_TRIMESH

 

Object Collider Types
Collider Types Description
CUBE A basic bounding box collider
SPHERE A basic sphere collider
CAPSULE (EMPTYOBJECT ONLY) A basic capsule collider.

 

Material Types
Material Types Description/Requirements
solid A basic solid rendering
solid2 A basic 2 layer solid rendering. Use setMaterialTexture() to set the second layer.
lightmap A lightmap rendering. Texture 1 is the main texture, Texture 2 is the lightmap
lightmaplight Same as lightmap, but accepts dynamic lighting
normalmap_solid A normalmapped solid. Texture 1 is the texture, Texture 2 is the normal map.
parallax_solid Same as Normal mapped, but using a parallax method
sphere_map Creates a reflective surface. Texture 1 is the spheremap texture.
detail_map Creates a detailmapped surface. Useful for terrain rendering. Texture 1 is the main texture, Texture 2 is the detailmap texture
spheremap2 Creates a textured spheremap. Texture 1 is the main texture, Texture 2 is the spheremap texture.
transparent_alpha IN PROGRESS
transparent_alpha_fast IN PROGRESS
transparent_add IN PROGRESS

 

Material Flags
Material Flags Values
wireframe 0 or 1
pointcloud 0 or 1
gouraud_shading 0 or 1
lighting 0 or 1
zbuffer 0 or 1
zwrite 0 or 1
backface_culling 0 or 1
frontface_culling 0 or 1
bilinear 0 or 1
trilinear 0 or 1
ansiotropic 0 or 1
fog 0 or 1
normalize_normals 0 or 1
antialias 0 or 1

 

Clone this wiki locally