RenderTask
Represents a rendering task for Figura to complete each frame
An abstract superclass of ItemTask, BlockTask, TextTask, and SpriteTask
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
- Overload 1
- Overload 2
setLight(light)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
light | Vector2 | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
setLight(blockLight, skyLight)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
blockLight | Integer | - | - |
skyLight | Integer | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
getLight()
Returns the light override value of this task
getLight()
Returns:
Type | Description |
---|---|
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:
Name | Type | Description | Default |
---|---|---|---|
matrix | Matrix4 | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
getName()
Get this task's name
getName()
Returns:
Type | Description |
---|---|
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:
Type | Description |
---|---|
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:
Type | Description |
---|---|
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
- Overload 1
- Overload 2
setOverlay(overlay)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overlay | Vector2 | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
setOverlay(whiteOverlay, hurtOverlay)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
whiteOverlay | Integer | - | - |
hurtOverlay | Integer | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
getOverlay()
Returns the overlay override value of this task
getOverlay()
Returns:
Type | Description |
---|---|
Vector2 | - |
setPos()
Aliases: pos()
Sets the position of the task, relative to its attached part
Uses model coordinates
- Overload 1
- Overload 2
setPos(pos)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pos | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
setPos(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
getPos()
Gets this task position
getPos()
Returns:
Type | Description |
---|---|
Vector3 | - |
getPositionMatrix()
Recalculates the matrix for this render task, based on its current position, rotation, scale, and pivot, then returns this matrix
getPositionMatrix()
Returns:
Type | Description |
---|---|
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:
Type | Description |
---|---|
Matrix4 | - |
setRot()
Aliases: rot()
Sets the rotation of the task, relative to its attached part
- Overload 1
- Overload 2
setRot(rot)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rot | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
setRot(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
getRot()
Gets this task rotation
getRot()
Returns:
Type | Description |
---|---|
Vector3 | - |
setScale()
Aliases: scale()
Sets the scale of the task, relative to its attached part
- Overload 1
- Overload 2
setScale(scale)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scale | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
setScale(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
getScale()
Gets this task scale
getScale()
Returns:
Type | Description |
---|---|
Vector3 | - |
setVisible()
Aliases: visible()
Sets whether or not this task should be rendered
setVisible(visible)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
visible | Boolean | - | - |
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |
isVisible()
Checks if this task is visible
isVisible()
Returns:
Type | Description |
---|---|
Boolean | - |
remove()
Removes this render task from the parent model part
remove()
Returns:
Type | Description |
---|---|
RenderTask | Returns self for chaining |