SpriteAnimation.lua
Tile.lua
Neo3D.lua
QuadTree.lua
Widget.lua
Sprite.lua
Collision.lua
OEntity.lua
Button.lua
Graphics2D.lua
InputField.lua
LuaUnit.lua
Tests.lua
OCamera.lua
Object3d.lua
class.lua
OLight.lua
SpriteSheet.lua
OSound.lua
Utils.lua
Canvas.lua
Label.lua
Api.lua

function getCurrentAnimation(object)


Retrieve the current animation ID the given object uses.


Parameter

object

The object which is animated.

Return: The animation ID as a number.

function changeAnimation(object, animationId)


Plays an animation.

Changes the current animation to the given one. No animation blending is done.

Parameter

object

The animated object.

animationId

The new animation to play.

function isAnimationOver(object)


Checks if the current animation has finished playing.

Also returns true for looped animations if the animation finished this frame.

Parameter

object

The animated object.

Return: A boolean value.

function getAnimationSpeed(object)


Retrieves the speed of the current animation.

TODO: Get data about the speed unit!

Parameter

object

The animated object.

Return: The animation speed.

function setAnimationSpeed(object, speed)


Changes the speed of the current animation.

TODO: Get data about the speed unit!

Parameter

object

The animated object.

speed

The animation speed.

function getCurrentFrame(object)


Retrieves the current frame in the current animation.


Parameter

object

The animated object.

Return: The current frame as a number.

function setCurrentFrame(object, frame)


Jumps to the given frame of the current animation.


Parameter

object

The animated object.

frame

The the frame to jump to.

function changeCurrentCamera(object)


Changes the current active camera.

This change will apply in the next frame and not immediately.


Parameter

object

The new active camera.

function getCurrentCamera()


Retrieves the active camera.

Return: The active camera.

function getCameraClearColor(object)


Retrieves the clear color from the given camera.

Example:


color = getCameraClearColor(camera)
print("Color: R = " .. color[1] .. " G = " .. color[2] .. " B = " .. color[3])


Return: The color as a vec3.

function getCameraFov(object)


Retrieves the field of view from the given camera.

Parameter

object

The FOV as a number.

function getCameraNear(object)


Retrieves the distance to the near plane from the given camera.

Parameter

object

The distance as a number.

function getCameraFar(object)


Retrieves the distance to the far plane from the given camera.

Parameter

object

The distance as a number.

function getCameraFogDistance(object)


Retrieves the distance to the fog from the given camera.

Parameter

object

The distance as a number.

function isCameraOrtho(object)


Checks if the given camera is configured to be orthographic.

Parameter

object

The camera.

Return: A boolean.

function isCameraFogEnabled(object)


Checks if the given camera is configured to render fog.

Parameter

object

The camera.

Return: A boolean.

function setCameraFov(object, fov)


Changes the field of view of the given camera.

Parameter

object

The camera.

fov

The new field of view.

function setCameraNear(object, near)


Changes the distance to the near plane of the given camera.

Parameter

object

The camera.

near

The new distance.

function setCameraFar(object, far)


Changes the distance to the far plane of the given camera.

Parameter

object

The camera.

far

The new distance.

function setCameraFogDistance(object, fogDistance)


Changes the distance to the fog rendered by the given camera.

Parameter

object

The camera.

fogDistance

The new distance.

function enableCameraOrtho(object, ortho)


Updates the cameras matrix setup to allow orthographic rendering.

Parameter

object

The camera.

ortho

A boolean value representing the new state.

function enableCameraFog(object, fog)


Enables fog rendering for the given camera.

Parameter

object

The camera.

fog

A boolean value representing the new state.

function enableCameraLayer(object, scene)


Turns the image that the given scene renders into an overlay over the given camera.

For rendering the scene as an overlay the default camera in that scene is used.



     camera = getObject("MainCamera")
     guiScene = getScene("GuiScene")

     enableCameraLayer(camera, guiScene)


Parameter

object

The camera.

scene

The scene to overlay.


Disables the scene overlay attached to the given camera.

Parameter

object

The camera with the scene layer.

function enableRenderToTexture(object, texturePath, renderWidth, renderHeight)


Enables render to texture for the given camera.

This function allows you to setup any camera to render to a specific
material. For this you specify the texture path to the texture you want to replace.
Attention: This will _not_ modify the texture on disk!

All surfaces referencing this texture file will be replaced by the rendered image.



camera = getObject("MainCamera")
enableRenderToTexture(camera, "maps/white.png", 1024, 1024)


Parameter

object

The camera which is used to render the scene.

texturePath

The path to the texture file to replace.

renderWidth

The width of the render target in pixel (does not need to match the actual texture file)

renderHeight

The width of the render target in pixel (does not need to match the actual texture file)

function disableRenderToTexture(object)


Disables render to texture for the given camera.

Parameter

object

The camera.

function getProjectedPoint(object, point)


Converts global vector to a projected vector inside the given camera viewport.


Parameter

object

The camera.

point

A vec3 containing positional data.

Return: A vec3 containing the transformed vector.

function getUnProjectedPoint(object, point)


Converts a projected vector to a global vector using the given camera.

This conversion uses the camera to determine the global coordinates for a
perspectively transformed point. This can be used to generate a ray for use in
raytracing as shown in the example.


camera = getObject("MainCamera")

-- Start the ray at the center of the screen
p1 = getUnProjectedPoint(camera, vec3(0.5, 0.5, 0))
p2 = getUnProjectedPoint(camera, vec3(0.5, 0.5, 1))

point, object = rayHit(p1, p2)



Parameter

object

The camera to use.

point

A vec3 containing positional data.

Return: A vec3 containing the converted data.

function vec3(float x, float y, float z)


Creates a 3D vector.

Parameter

x

The X value

y

The Y value

z

The Z value

Return: The newly created 3D vector

function length(vec3)


Calculates the length of a 3D vector.

Parameter

vec3

The 3D vector to use.

Return: The length of the vector.

function normalize(vec3)


Normalizes a vector

This function takes the input vector and transforms it
to a new vector with the length 1.0f.


Parameter

vec3

The vector to normalize.

Return: The normalized vec3.

function dot(vecA, vecB)


This function calculates the dot product of two vectors.


Parameter

vecA

The first vector.

vecB

The second vector.

Return: The one dimensional scalar product.

function cross(vecA, vecB)


This function calculates the cross product of two vectors.

Parameter

vecA

The first vector.

vecB

The second vector.

Return: The calculated vector.

function isKeyPressed(key)


Checks, if the given key is currently pressed.

See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameter

The

name of the key.

Return: A boolean value.

function onKeyDown(key)


Checks, if the given key got pressed in this frame.

See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameter

The

name of the key.

Return: A boolean value.

function onKeyUp(key)


Checks, if the given key got released in this frame.

See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameter

The

name of the key.

Return: A boolean value.

function getAxis(axis)


Retrieves the current axis value of a joystick or mouse.

The value is between 0.0 and 1.0


See also: http://www.neo-engine.de/wordpress/?wpwtds_article=key-and-axis-literals

Parameter

The

name of the key.

Return: A float value.

function getTouchPosition(touchId)


Retrieves the current touch position on touch devices.

Is the same as the mouse cursor position since SDL makes no difference between them.

Parameter

The

touch device ID

Return: The touch position.

function loadLevel(filename)


Loads a specific level file.
Example:


loadLevel("levels/menu.level")


Parameter

filename

The level to load.

function getScene(name)


Retrieves the scene with the given name.

Parameter

name

The name of the scene.

Return: The scene.

function changeScene(scene)


Changes the current scene to the given scene.

See also: getScene


Parameter

scene

The new scene.

function getCurrentSceneId()


Retrieves the ID of the current scene.

Return: A number.

function getScenesNumber()


Returns the number of scenes in the current level.

Return: A number.

function getLightColor(object)


Returns the color of the given light source.

The color is encoded as a vec3.

Parameter

object

The light source.

Return: The color.

function getLightRadius(object)


Returns the radius of the given light source.

Parameter

object

The light source.

Return: A number.

function getLightIntensity(object)


Returns the intensity of the given light source.

Parameter

object

The light source.

Return: A number.

function getLightShadowQuality(object)


Returns the shadow quality of the given light source.

Parameter

object

The light source.

Return: A number.

function getLightShadowBias(object)


Returns the bias of the given light source.

Parameter

object

The light source.

Return: A number.

function getLightShadowBlur(object)


Returns the blur factor of the given light source.

Parameter

object

The light source.

Return: A number.

function getLightSpotAngle(object)


Returns the spot angle of the given light source.

Parameter

object

The light source.

Return: A number.

function getLightSpotExponent(object)


Returns the spot exponent of the given light source.

Parameter

object

The light source.

Return: A number.

function setLightColor(object, color)


Changes the color of the given light source.


setLightColor(light, {0.5,0.5,0.5})


Parameter

object

The light source.

color

A vec3 containing the RGB values.

function setLightRadius(object, radius)


Changes the radius of the given light source.

Parameter

object

The light source.

radius

A number.

function setLightIntensity(object, intensity)


Changes the intensity of the given light source.

Parameter

object

The light source.

intensity

A number.

function setLightShadowQuality(object, quality)


Changes the shadow quality of the given light source.

The shadow quality is basically the resolution of the texture
the depth data will be rendered to. The resolution looks like "quality x quality"
and works best if quality is a power of two like 1024 or 2048.


Parameter

object

The light source.

quality

A number. Works best with a power of two.

function setLightShadowBias(object, bias)


Changes the shadow bias of the given light source.

Parameter

object

The light source.

bias

A number.

function setLightShadowBlur(object, blur)


Changes the shadow blur of the given light source.

The shadow blur describes the number of passes the GLSL shader
uses to blur the shadow edge. Bigger values might slow down your game!


Parameter

object

The light source.

blur

A number. Keep this as small as possible!

function setLightSpotAngle(object, spotAngle)


Changes the spot angle of the given light source.

The spot angle describes the angle a spot light is able to illuminate.
A point light has an angle > 180° and can be turned into a spot light
by setting a smaller spot angle.


Parameter

object

The light source.

spotAngle

A number.

function setLightSpotExponent(object, exponent)


Changes the spot exponent of the given light source.

The spot exponent describes the strength of blending out the
illuminated area of the spot light on the edges.


Parameter

object

The light source.

exponent

A number.

function getObject(scene, name)


Gets the object with the given name.

Can also give objects from other scenes than the current one.

Parameter

scene

The scene to look in. This parameter is optional.

name

The name of the object to retrieve.

function getParent(object)


Retrieves the parent of an object.

Parameter

The

object to retrieve the parent from. See also: getObject

Return: The parent object.

function getChilds(object)


Returns a list of all childrens from the given object.

Parameter

object

The parent object.

Return: The list of all children.

function getClone(object)


Creates a clone of the given object.

Parameter

object

The object to clone.

Return: The clone.

function setParent(object, parent)


Changes the parent of the given object.

Resets parent-child relationship if parent = nil.

Parameter

object

The object.

parent

The new parent.

function getName(object)


Retrieves the name of the given object.

Parameter

object

The object.

Return: The name of the object.

function activate(object)


Activates the given object.

Parameter

object

The object.

function deactivate(object)


Deactivates the given object.

This function does not delete the object from memory!
It will just set invisible and removed from the physics simulation.

Parameter

object

The object.

function isVisible(object)


Checks if the given object is visible.

Parameter

object

The object.

Return: A boolean value.

function isActive(object)


Checks if the given object is active.

Parameter

object

The object.

Return: A boolean value.

function enableShadow(object, shadow)


Specifies, if a light renders shadows or if an entity has a shadow.

Parameter

object

The entity/light.

shadow

A boolean value.

function isCastingShadow(object)


Checks if a light renders shadows or if an entity has a shadow.

Parameter

object

The entity/light.

Return: A boolean value.

function setGravity(vec3)


Sets the current gravity.

Example:


setGravity({0,0,-0.5})


Parameter

vec3

A vec3 containing the new gravitational pull.

function getGravity()


Returns the gravity in the current scene.

Return: A vec3 containing the gravitational pull.

function getLinearDamping(object)


Returns the linear damping from the given object.

Parameter

object

The physically active object

Return: A number containing the linear damping.

function setLinearDamping(object, damping)


Sets the linear damping of the given object.

Parameter

object

The physically active object

damping

A number containing the linear damping.

function getAngularDamping(object)


Returns the angular damping from the given object.

Parameter

object

The physically active object

Return: A number containing the angular damping.

function setAngularDamping(object, damping)


Sets the angular damping of the given object.

Parameter

object

The physically active object

damping

A number containing the angular damping.

function getLinearFactor(object)


Returns the linear factor from the given object.

Parameter

object

The physically active object

Return: A vec3 containing the linear factor.

function setLinearFactor(object, factor)


Sets the linear factor of the given object.

Parameter

object

The physically active object

factor

A vec3 containing the linear factor.

function getAngularFactor(object)


Returns the angular factor from the given object.

Return: A number containing the linear factor.

function setAngularFactor(object, factor)


Sets the angular factor of the given object.

Parameter

object

The physically active object

factor

A number containing the angular factor.

function getMass(object)


Returns the mass of the given object.

Parameter

object

The physically active object.

Return: A number.

function setMass(object, mass)


Sets the mass of the given object.

Parameter

object

The physically active object.

mass

The new mass.

function getFriction(object)


Returns the friction constant of the given object.

Parameter

object

The physically active object.

Return: A number.

function setFriction(object, friction)


Sets the friction constant of the given object.

Parameter

object

The physically active object.

friction

The new friction.

function getRestitution(object)


Returns the physical restitution of the given object.

Parameter

object

The physically active object.

Return: A number.

function setRestitution(object, restitution)


Sets the restitution of the given object.

Parameter

object

The physically active object.

restitution

The new restitution.

function clearForces(object)


Removes all active forces from the given object.

Parameter

object

The physically activated object.

function addCentralForce(object, force, mode)


Applies a new central force to the given object.

The new force will be added to the currently existing central force of the
object. The mode parameter is optional and allows you to apply forces relative to the objects
current rotation.


Parameter

object

The physically active object.

force

A vec3 containing the force to apply.

mode

A string containing "local". Can be left out.

function addTorque(object, torque, mode)


Applies a new torque to the given object.

The new torque will be added to the currently existing torque of the
object. The mode parameter is optional and allows you to apply a torque relative to the objects
current rotation.


Parameter

object

The physically active object.

torque

A vec3 containing the torque to apply.

mode

A string containing "local". Can be left out.

function getCentralForce(object)


Returns the force applied to the given object.

Parameter

object

The physically active object.

Return: A vec3.

function getTorque(object)


Returns the torque applied to the given object.

Parameter

object

The physically active object.

Return: A vec3.

function isCollisionTest(object)


Checks if the object is colliding at all.

Parameter

object

The physically active object.

Return: A boolean.

function isCollisionBetween(object1, object2)


Checks if the two given objects are colliding.

Parameter

object1

The physically active object.

object2

The physically active object.

Return: A boolean.

function getNumCollisions(object)


Returns the total number of collisions the given object currently has.

Parameter

object

The physically active object.

Return: A number.

function pauseSound(object)


Pauses the given sound.

Playback can be resumed by using playSound.

Parameter

object

A sound object.

function stopSound(object)


Stops the given sound.

Playback can be restarted by using playSound.

Parameter

object

A sound object.

function getSoundGain(object)


Retrieves the sound volume from the given sound object.

Parameter

object

A sound object.

Return: A number.

function setSoundGain(object, gain)


Sets the sound volume of the given sound object.

The volume level is should be between 0.0 and 1.0 to prevent distortion.

Parameter

object

A sound object.

gain

A number between 0.0 and 1.0

function centerCursor()


Sets the cursor to the center of the screen.

function hideCursor()


Hides the cursor.

function showCursor()


Shows the cursor.

function getWindowScale()


Retrieves the current window resolution.

Example:


resolution = getWindowScale()
print("The window has a resolution of " .. resolution[1] .. "x" .. resolution[2])


Return: The resolution as a vec2.

function getSystemTick()


Returns the number of milliseconds that passed since the application started.

Return: The current tick count.

function quit()


Quits the game.

The player will terminate, the editor will return to an editing environment.

function dofile(file)


Includes a file into script for execution.

Will look for scripts in "$PROJECT_DIR/scripts".
The example would load "$PROJECT_DIR/scripts/filename.lua".

Example:

 dofile("filename.lua") 


Parameter

file

The file to execute.

function setText(object , text)


Changes the string displayed by a text object.

Example:

 setText(textobject, "Sometext!")


Parameter

object

The text object.

text

The new string.

function getText(object)


Retrieves the string displayed by a text object.

Parameter

object

The text object.

Return: The current string.

function getTextColor(object)


Retrieves the color displayed by a text object.

Example:


color = getTextColor(object)
print("Color: R = " .. color[1] .. " G = " .. color[2] .. " B = " .. color[3] .. " A = " .. color[4])


Parameter

object

The text object.

Return: The current color as a vec4.

function setTextColor(object, color)


Sets the color displayed by a text object.

Example:


setTextColor(object, {r,g,b,a})


Parameter

object

The text object.

color

The new color as a vec4.

function rotate(object, axis, angle, "local")


Rotates an object.

The local parameter is optional.
Example:


-- Rotate around X-Axis
rotate(object, {1,0,0}, 90)



Parameter

object

The object to rotate.

axis

An vec3 containing the axis to rotate around.

angle

The angle to rotate.

local

Specifies if the rotation is in the global or the local space.

function translate(object, {x, y, z}, "local")


Translates an object.

The local parameter is optional.
Example:


-- Translate on X-Axis in the local space

rotate(object, {15,0,0}, "local")




Parameter

object

The object to translate.

axis

An vec3 containing the direction to translate to.

local

Specifies if the translation is in the global or the local space.

function getPosition(object)


Retrieves the position of an object.

Parameter

object

The object.

Return: A vec3 containing the current position.

function getRotation(object)


Retrieves the rotation of an object.

Parameter

object

The object.

Return: A vec3 containing the current rotation.

function getScale(object)


Retrieves the scale of an object.

Parameter

object

The object.

Return: A vec3 containing the current scale.

function setPosition(object, pos)


Sets the position of an object.

Parameter

object

The object.

pos

A vec3 containing the new position.

function setRotation(object, rot)


Sets the rotation of an object.

Parameter

object

The object.

rot

A vec3 containing the new rotation.

function setScale(object, scale)


Sets the scale of an object.

Parameter

object

The object.

scale

A vec3 containing the new scale.

function getTransformedPosition(object)


Retrieves the transformed position of an object.

This includes all transformations done by parents.


Parameter

object

The object.

Return: A vec3 containing the current position.

function getTransformedRotation(object)


Retrieves the transformed rotation of an object.

This includes all transformations done by parents.


Parameter

object

The object.

Return: A vec3 containing the current rotation.

function getTransformedScale(object)


Retrieves the transformed scale of an object.

This includes all transformations done by parents.


Parameter

object

The object.

Return: A vec3 containing the current scale.

function getInverseRotatedVector(object, vector)


Calculates the inverse rotated vector according to the matrix of the object.


Parameter

object

The object.

vector

The vec3 containing positional data.

Return: A vec3 with the transformed data.

function getRotatedVector(object, vector)


Rotates the given vector according to the matrix of the given object.


Parameter

object

The object.

vector

The vec3 containing positional data.

Return: A vec3 with the transformed data.

function getInverseVector(object, vector)


Calculates the inverse vector according to the matrix of the object.

This can be useful for converting global vectors into local vectors.


Parameter

object

The object.

vector

The vec3 containing positional data.

Return: A vec3 with the transformed data.

function getTransformedVector(object, vector)


Multiplies the given with the matrix of the given object.

This is useful for converting local to global coordinates.

Parameter

object

The object.

vector

The vec3 containing positional data.

Return: A vec3 with the transformed data.

function updateMatrix(object)


Recalculates the matrix of the given object.

Parameter

object

The object.

function getMatrix(object)


Retrieves the matrix of an object as a table.


Parameter

object

The object.

Return: A table containing the current matrix.

function objectExists(name)


Checks if the object with the given name exists.

Parameter

name

The name of the object as a string

Return: A boolean.

function loadCameraSkybox(camera, path)


Loads a skybox from the given path.
The textures need to be in a directory and need to be named
in the fashion of "posx.jpg", "negx.jpg", "posy.jpg", "negy.jpg",
"posz.jpg", "negz.jpg"

Parameter

camera

The camera object.

path

The path to the directory containing textures

function deleteObject(object)


Deletes the given object from the scene and
free's its memory.

Attention: Do not use objects after deleting them!

Parameter

object

The object to delete

function resizeWindow(width, height)


Resizes the game window.

Parameter

width

The new width

height

The new height

function getMeshFilename(object)


Retrieves the filename of the mesh from the given entity.

Parameter

An

entity

Return: A string containing the path

function loadMesh(filename)


Loads a mesh from disk and adds it as an entity to the current
scene.

Parameter

filename

Path to the mesh file.

Return: The new object

function getObjectType(object)


Retrieves the object type of the given object

Valid return values are
"Entity", "Camera", "Light", "Sound", "Text", "Object"

Return: The type as a string

function getBoundingMax(object)


Returns the maximum point of the given entity as a vec3.

Parameter

object

The object

Return: The point in space

function getBoundingMin(object)


Returns the minimum point of the given entity as a vec3.

Parameter

object

The object

Return: The point in space

function createGroup()


Creates an empty group.
Groups have the type "Object" when using "getObjectType(object)"

Return: The empty group

function getBehaviorsNumber(object)


Returns the number of behaviors an object has attached.
If the operation fails it returns '-1'.

Parameter

object

The object to operate on.

Return: The number of behaviors

function getBehaviorName(object, idx)


Returns the name of a behavior that is attached to the given object.

Parameter

object

The object.

idx

The index of the behavior.

Return: The name as a string.

function getBehaviorVariablesNumber(object, idx)


Returns the number of variables a behavior owns.

Parameter

object

The object.

idx

The index of the behavior.

Return: The count as a number.

function getBehaviorVariableType(object, bid, vid)


Returns the variable type of a variable that belongs to a behavior
as a string.
Valid values are:
"bool", "vec2", "vec3", "vec4", "float", "int", "string", "uint"

Parameter

object

The object to operate on

bid

The behavior ID

vid

The variable ID

Return: The type as a string

function addBehavior(object, behaviorName)


Adds a new behavior to the given object.

Parameter

object

The object.

behaviorName

The name of the behavior to add.

function enablePhysics(object, enabled)


Enables or disables all physics properties of an object.

Parameter

object

The object to operate on.

enabled

A boolean.

function setMass(object, mass)


Sets the physical mass of an object.

Parameter

object

The entity.

mass

The new mass as a number.

function getMass(object)


Returns the physical mass of an object.

Parameter

object

The entity.

Return: The mass as a number.

function getFriction(object)


Returns the physical friction of an entity.

Parameter

object

The entity.

Return: The friction as a number.

function setFriction(object, friction)


Sets the physical friction of an entity.

Parameter

object

The entity

friction

The new friction as a number.

function getRestitution()


Returns the physical restitution of an object.

Parameter

object

The entity

Return: The restitution as a number.

function setRestitution(object, rest)


Sets the physical restitution of an entity.

Parameter

object

The entity

rest

The new restitution as a number.

function getAngularFactor(object)


Returns the physical angular factor of an object.

Parameter

object

The entity

Return: The angular factor as a number.

function setAngularFactor(object, value)


Sets the physical angular factor of an entity.

Parameter

object

The entity

value

The new angular factor as a number.

function getLinearFactor()


Returns the physical linear factor of an object.

Parameter

object

The entity

Return: The linear factor as a number.

function setLinearFactor(object, value)


Sets the physical linear factor of an entity.

Parameter

object

The entity

value

The new linear factor as a number.

function setPhysicsQuality(value)


Sets the physics quality. The default value is 2, higher values mean
higher precision.

Parameter

value

The new value as a number.

function setConstraintParent()


Changes the physical parent of an entity.

Parameter

object

The entity

parent

The new parent

function getConstraintParent()


Returns the current physical parent or nil if there is none.

Parameter

object

The entity to operate on

Return: The parent as an object.

function enableParentCollision(object, enabled)


Enables or disables collision with the physical parent object.

Parameter

object

The entity.

enabled

A boolean value.

function isGhost(object)


Returns if the given entity is or is no ghost object.

Parameter

object

The entity.

Return: A boolean

function enableGhost(object, enabled)


Enables/Disables the ghost property of an entity.

Parameter

object

The entity

enabled

A boolean

function loadSound(filename)


Loads a sound from the given file and adds it to the current scene.

Parameter

filename

The file to load.

Return: The new sound object

function getSoundFilename(sound)


Returns the filename of the given sound object.

Parameter

The

sound object

Return: The filename as a string

function getSoundPitch(object)


Returns the sound pitch of a sound object.

Parameter

object

The sound object.

Return: The pitch as a number.

function setSoundPitch(object, value)


Changes the sound pitch.

Parameter

object

The sound object

value

The new pitch

function getSoundRolloff(object)


Returns the sound rolloff value

Parameter

object

The sound object

Return: The sound rolloff as a number

function setSoundRolloff(object, value)


Changes the sound rolloff of a sound

Parameter

object

The sound object

value

The new rolloff value

function getSoundRadius(object)


Returns the sound radius of a sound object.

Parameter

object

The sound object

Return: The radius as a number

function setSoundRadius(object, value)


Changes the sound radius of a sound object.

Parameter

object

The sound object

value

The new radius as a number

function isSoundRelative(object)


Checks if the sound is relative

Parameter

object

The sound object

Return: A boolean

function setSoundRelative(object, enabled)


Sets the sound relative according to the given value

Parameter

object

The sound object

enabled

A boolean

function isSoundLooping(object)


Checks if the sound is looping

Parameter

object

The sound object

Return: A boolean

function setSoundLooping()


Sets the sound relative according to the given value

Parameter

object

The sound object

enabled

A boolean

function createLight()


Creates a new light object

Return: The new light object

function createCamera()


Creates a new camera object

Return: The new camera

function loadTextFont(filename)


Creates a new text object with the given font

Parameter

filename

The path to the font to use

Return: A new text object

function getFontFilename(object)


Returns the file name of the font used by the given text object.

Parameter

object

The text object

Return: the file as a string

function getTextFontSize(object)


Returns the font size of the given text

Parameter

object

The text object

Return: The font size as a number

function setTextFontSize(object, size)


Changes the font size of the given text

Parameter

object

The text object

size

The new size as a number

function setTextAlignment(object, alignment)


Changes the text alignment

The alignment is given as a string.
Valid values are: "Center", "Left", "Right"

Parameter

object

The text object

align

The new alignment as a string

function getTextAlignment(object)


Returns the text alignment

The alignment is given as a string.
Valid values are: "Center", "Left", "Right"

Parameter

object

The text object

Return: The alignment as a string

function getWorkingDirectory()


Returns the current working directory

Return: The working directory as a string

function loadTextFile(filename)


Loads a text file completely from disk. Also accesses files inside
the game NPK after the game is published.

Parameter

filename

The file to load.

Return: The content as a string

function isFileExist(filename)


Checks if a file exists

Parameter

filename

The file to check

Return: A boolean

function createDirectory(path)


Creates a new directory.

Parameter

path

The directory to create.