Skip to content

Components

Maks edited this page Feb 18, 2019 · 6 revisions

Components

Name

Just a string

Transform

Properties Type Notes
position vector3 table local position
rotation vector3 table local rotation in euler angles in degrees
scale vector3 table local scale

Transform:move(x, y, z)

Transform:rotate(angle, x, y, z)

Rotates angle degrees around axis (x,y,z). Normalizes the axis internally.

Transform:scale(x, y, z)

Multiplies the current scale by the given values.

RenderInfo

Properties Type Notes
mesh string path to the mesh, relative to the assets folder. Write-only.
isEnabled bool

RenderInfo.material, is currently only settable when creating the component out of a component definition. See Game.makeActor. Supported properties of material:

Properties Type Notes
diffuseColor vector3 table
diffuseMap string path to the diffuse map
specularColor vector3 table
specularMap string path to the specular map
shininess number shininess in ADS shading

Camera

No properties or functions at the moment.

Light

Properties Type Notes
color vector3 table
intensity number
colorAmbient string ignores intensity
kind string "Point", "Directional" or "Spot". Currently only settable through a component definition (see Game.makeActor).

Rigidbody

Properties Type Notes
isKinematic bool
useGravity bool
bounciness number should be between 0 and 1
radius number Because collision detection is currently only supported between spheres
velocity vector3 table

UIRect

Properties Type Notes
anchorMin vector2 table the bottom-left anchor point in normalized coordinates, relative to the parent element
anchorMax vector2 table the top-right anchor point in normalized coordinates, relative to the parent element
offsetMin vector2 table the vector in pixels from the bottom-left anchor-point to the bottom-left corner of the element
offsetMax vector2 table the vector in pixels from the top-right anchor-point to the top-right corner of the element
pivot vector2 table a vector in normalized coordinates that specifies the point around which the object is rotated and scaled. (0, 0) if bottom-left corner, (1, 1) is top-right, (0.5, 0.5) is center. (0.5, 0.5) by default.
isEnabled bool
isMouseOver bool read-only
wasMouseOver bool read-only

Sprite

Properties Type Notes
material material can only be set when creating the sprite
isEnabled bool
textureSize vector2 table read-only