Skip to main content

RenderTask

Represents a rendering task for Figura to complete each frame

An abstract superclass of ItemTask, BlockTask, TextTask, and SpriteTask

warning

This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.


setLight()

Aliases: light()

Sets the light override value of this task

Values are given from 0 to 15, indicating the block light and sky light levels you want to use

Passing nil will reset the lighting override for this task

setLight(light)

Parameters:

NameTypeDescriptionDefault
lightVector2--

Returns:

TypeDescription
RenderTaskReturns self for chaining

getLight()

Returns the light override value of this task

getLight()

Returns:

TypeDescription
Vector2-

setMatrix()

Aliases: matrix()

Sets the given matrix as the position matrix for this render task

The normal matrix is automatically calculated as the inverse transpose of this matrix

Calling this DOES NOT CHANGE the values of position, rot, or scale in the render task

If you call setPos() or a similar function, the effects of setMatrix() will be overwritten

setMatrix(matrix)

Parameters:

NameTypeDescriptionDefault
matrixMatrix4--

Returns:

TypeDescription
RenderTaskReturns self for chaining

getName()

Get this task's name

getName()

Returns:

TypeDescription
String-

getNormalMatrix()

Recalculates the normal matrix for this render task, based on its current position, rotation, scale, and pivot, then returns this matrix

getNormalMatrix()

Returns:

TypeDescription
Matrix3-

getNormalMatrixRaw()

Returns the normal matrix for this render task

The Raw version of the function is different in that it doesn't recalculate the matrix before returning it

getNormalMatrixRaw()

Returns:

TypeDescription
Matrix3-

setOverlay()

Aliases: overlay()

Sets the overlay override value of this task

Values you give are 0 to 15, indicating the white overlay and the damage overlay levels you want to use

Passing nil will reset the overlay override for this task

setOverlay(overlay)

Parameters:

NameTypeDescriptionDefault
overlayVector2--

Returns:

TypeDescription
RenderTaskReturns self for chaining

getOverlay()

Returns the overlay override value of this task

getOverlay()

Returns:

TypeDescription
Vector2-

setPos()

Aliases: pos()

Sets the position of the task, relative to its attached part

Uses model coordinates

setPos(pos)

Parameters:

NameTypeDescriptionDefault
posVector3--

Returns:

TypeDescription
RenderTaskReturns self for chaining

getPos()

Gets this task position

getPos()

Returns:

TypeDescription
Vector3-

getPositionMatrix()

Recalculates the matrix for this render task, based on its current position, rotation, scale, and pivot, then returns this matrix

getPositionMatrix()

Returns:

TypeDescription
Matrix4-

getPositionMatrixRaw()

Returns the position matrix for this render task

The Raw version of the function is different in that it doesn't recalculate the matrix before getting it

getPositionMatrixRaw()

Returns:

TypeDescription
Matrix4-

setRot()

Aliases: rot()

Sets the rotation of the task, relative to its attached part

setRot(rot)

Parameters:

NameTypeDescriptionDefault
rotVector3--

Returns:

TypeDescription
RenderTaskReturns self for chaining

getRot()

Gets this task rotation

getRot()

Returns:

TypeDescription
Vector3-

setScale()

Aliases: scale()

Sets the scale of the task, relative to its attached part

setScale(scale)

Parameters:

NameTypeDescriptionDefault
scaleVector3--

Returns:

TypeDescription
RenderTaskReturns self for chaining

getScale()

Gets this task scale

getScale()

Returns:

TypeDescription
Vector3-

setVisible()

Aliases: visible()

Sets whether or not this task should be rendered

setVisible(visible)

Parameters:

NameTypeDescriptionDefault
visibleBoolean--

Returns:

TypeDescription
RenderTaskReturns self for chaining

isVisible()

Checks if this task is visible

isVisible()

Returns:

TypeDescription
Boolean-

remove()

Removes this render task from the parent model part

remove()

Returns:

TypeDescription
RenderTaskReturns self for chaining