Animation Node

An Animation Node creates a 2D plane that plays a PNG sequence or displays an image.

Function Description
animation() Returns the Animation object of the Animation Node. This is the actual asset of the node.
color() Returns the color of the Animation node.
depth() Returns the depth of the Animation node.
globalDepth()

Returns the depth of the Animation in a 2D World.

is3DMode() Returns true if the Animation Node is in 3D mode, and false if not.
isBillboardMode()

Returns true if the Animation is in billboard mode. An Animation in billboard mode will always face the camera.

localAABB()

Returns the local “axis-aligned bounding box” for the Animation. These coordinates form a box with the minimum corner at (left, bottom, near) and the maximum corner at (right, top, far).

position()

Returns the position of the Animation relative to its parent Entity.

rotation()

Returns the rotation of the Animation relative to its parent Entity.

scale()

Returns the scale of the Animation relative to its parent Entity.

set3DMode(value)

Set 3D Mode of the Animation node on or off.

setAnimation(value)

Sets the Animation attribute within the Animation node. This is like the “asset” of the Animation node. An Animation can be stored as a Script Attribute.

setBillboardMode(value)

Set billboard mode of the Animation node on or off. An Animation in billboard mode will always face the camera.

setColor(r, g, b, a)

Set the color of the Animation node.

setDepth(value)

Set the depth of the Animation node.

setGlobalDepth(value)

Set the depth of the Animation node in a 2D World.

setPosition(pos)

Sets the position of the animation component relative to its parent Entity. Note: These coordinates are scaled down, so 100 units here = 10 world units.

setPosition(x, y, z)

Sets the position of the animation component relative to its parent Entity. Note: These coordinates are scaled down, so 100 units here = 10 world units.

setRotation(x, y, z)

Sets the rotation of the animation component relative to its parent Entity. Note: These coordinates are scaled down, so 100 units here = 10 world units.

setScale(x, y, z)

Sets the scale of the animation component relative to its parent Entity.

setVisible(value)

Sets the visibility of the 3D Model.

transformedAABB()

Returns the relative “axis-aligned bounding box” for the Animation. These coordinates form a box with the minimum corner at (left, bottom, near) and the maximum corner at (right, top, far).

transformedOBB()

Returns the “oriented bounding box” for the Animation relative to its parent Entity. OBB is more precise but more performance-heavy than AABB.

worldAABB()

Returns the world (absolute) “axis-aligned bounding box” for the Animation. These coordinates form a box with the minimum corner at (left, bottom, near) and the maximum corner at (right, top, far).

worldOBB()

Returns the “oriented bounding box” for the Animation. OBB is more precise but more performance-heavy than AABB.


animation()

Returns the Animation object of the Animation Node. This is the actual asset of the node.

Returns

AnimationModel the Animation object of the Animation Node

↑ Back to top


color()

Returns the color of the Animation node. The range is 0-255 for each value (red, green, blue, alpha).

Returns

Object – the {r, g, b, a} representation of the Animation’s color.

↑ Back to top


depth()

Returns the depth of the Animation node. Depth decides which Animation is on top when the 3D Mode of the Animations is turned off. A higher value will be above a lower number.

Returns

Number – the depth of the Animation.

↑ Back to top


globalDepth()

Returns the global depth of the Animation node. Depth decides which object is on top in a 2D World. A higher value will be above a lower number in the Scene.

Returns

number value – The global depth of the Animation

↑ Back to top


is3DMode()

Returns

boolean true if the Animation is in 3D mode, false if not

↑ Back to top


isBillboardMode()

Returns true if the Animation is in billboard mode. An Animation in billboard mode will always face the camera.

Returns

boolean true if the Animation is in billboard mode, false if not

↑ Back to top


localAABB()

Returns the local “axis-aligned bounding box” for the Animation. These coordinates form a box with the minimum corner at (left, bottom, near) and the maximum corner at (right, top, far).

Returns

AABB AABB object containing relative AABB data

↑ Back to top


position()

Returns the position of the Animation relative to its parent Entity.

Returns

Vec3 the {x, y, z} relative position coordinates of the Animation

↑ Back to top


rotation()

Returns the rotation of the Animation relative to its parent Entity.

Returns

Vec3 the {x, y, z} relative rotation of the Animation

↑ Back to top


scale()

Returns the scale of the Animation relative to its parent Entity.

Returns

Vec3 the {x, y, z} relative scale of the Animation

↑ Back to top


set3DMode(value)

Set 3D Mode of the Animation node on or off.

Parameters

boolean value – True to turn 3D mode on, false to turn it off

↑ Back to top


setAnimation(value)

Sets the Animation attribute within the Animation node. This is like the “asset” of the Animation node. An Animation can be stored as a Script Attribute.

Parameters

AnimationModel value – the AnimationModel to set the Animation attribute to.

↑ Back to top


setBillboardMode(value)

Set billboard mode of the Animation node on or off. An Animation in billboard mode will always face the camera.

Parameters

boolean value – True to turn billboard mode on, false to turn it off

↑ Back to top


setColor(r, g, b, a)

Sets the color of the Animation node. The range is 0-255 for each value (red, green, blue, alpha). Alpha is optional.

Parameters

number r – the red component of the color
number g – the green component of the color
number b – the blue component of the color
number a – the alpha component of the color (optional)

↑ Back to top


setDepth(value)

Sets the depth of the Animation node. Depth decides which Animation is on top when the 3D Mode of the Animations is turned off. A higher value will be above a lower number in the Scene.

Parameters

number value – The depth of the Animation

↑ Back to top


setGlobalDepth(value)

Sets the global depth of the Animation node. Depth decides which object is on top in a 2D World. A higher value will be above a lower number in the Scene.

Parameters

number value – The global depth of the Animation

↑ Back to top


setPosition(pos)

Sets the position of the animation component relative to its parent Entity. Note: These coordinates are scaled down, so 100 units here = 10 world units.

Parameters

Vec3 pos – The new {x, y, z} relative coordinates of the Animation

↑ Back to top


setPosition(x, y, z)

Sets the position of the animation component relative to its parent Entity. Note: These coordinates are scaled down, so 100 units here = 10 world units.

Parameters

number x – The x component of the new position
number y – The y component of the new position
number z – The z component of the new position

↑ Back to top


setRotation(x, y, z)

Sets the rotation of the animation component relative to its parent Entity. Note: These coordinates are scaled down, so 100 units here = 10 world units. Can optionally take a Vec3 argument.

Parameters

number x – The x component of the new rotation
number y – The y component of the new rotation
number z – The z component of the new rotation

or

Vec3 – The {x, y, z} rotation

↑ Back to top


setScale(x, y, z)

Sets the scale of the animation component relative to its parent Entity.

Parameters

number x – The x component of the new scale
number y – The y component of the new scale
number z – The z component of the new scale

↑ Back to top


setVisible(value)

Sets the visibility of the 3D Model.

Parameters

boolean value – true for visible, false for not visible.

↑ Back to top


transformedAABB()

Returns the relative “axis-aligned bounding box” for the Animation. These coordinates form a box with the minimum corner at (left, bottom, near) and the maximum corner at (right, top, far).

Returns

AABB AABB object containing relative AABB data

↑ Back to top


transformedOBB()

Returns the “oriented bounding box” for the Animation relative to its parent Entity. OBB is more precise but more performance-heavy than AABB.

Returns

OBB OBB object containing relative OBB data

↑ Back to top


worldAABB()

Returns the world (absolute) “axis-aligned bounding box” for the Animation. These coordinates form a box with the minimum corner at (left, bottom, near) and the maximum corner at (right, top, far).

Returns

AABB AABB object containing world AABB data

↑ Back to top


worldOBB()

Returns the “oriented bounding box” for the Animation. OBB is more precise but more performance-heavy than AABB.

Returns

OBB OBB object containing OBB data

↑ Back to top

Did you find this page useful?

Please give it a rating:

Please provide some feedback!

This is very helpful to us.

Tell us how we can improve this post?