SpriteTask

subclasses RenderTask

A task for rendering a single Sprite

SpriteTask.getSize

Returns the width and height used to render this sprite
overload 1:
SpriteTask:getSize()
Method Property Fluent Description Representation
Return Value a Vector2

SpriteTask.getDimensions

Returns the texture dimensions, used in UV calculation
overload 1:
SpriteTask:getDimensions()
Method Property Fluent Description Representation
Return Value a Vector2

SpriteTask.getRegion

Gets the texture UV region
overload 1:
SpriteTask:getRegion()
Method Property Fluent Description Representation
Return Value a Vector2

SpriteTask.setSize

Sets the width and height used to render this sprite
overload 1:
SpriteTask:setSize(size)
Method Property Fluent Description Representation
size accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:setSize(width, height)
Method Property Fluent Description Representation
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.setColor

Sets a color multiplier for this sprite
Values are RGBA from 0 to 1
Default values are 1,
alpha is optional
overload 1:
SpriteTask:setColor(rgb)
Method Property Fluent Description Representation
rgb accepts a Vector3
Return Value a SpriteTask
overload 2:
SpriteTask:setColor(rgba)
Method Property Fluent Description Representation
rgba accepts a Vector4
Return Value a SpriteTask
overload 3:
SpriteTask:setColor(r, g, b, a)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
a accepts a Number
Return Value a SpriteTask

SpriteTask.setRegion

Sets the texture UV region
Uses its dimensions to calculate the max UV
overload 1:
SpriteTask:setRegion(region)
Method Property Fluent Description Representation
region accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:setRegion(width, height)
Method Property Fluent Description Representation
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.getUV

Gets this texture UV offset
overload 1:
SpriteTask:getUV()
Method Property Fluent Description Representation
Return Value a Vector2

SpriteTask.setUV

Sets this texture UV offset
The Region and Dimension are used to calculate the end UV
overload 1:
SpriteTask:setUV(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:setUV(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a SpriteTask

SpriteTask.getUVPixels

Get this texture UV offset, in pixels, based on the texture's dimension
overload 1:
SpriteTask:getUVPixels()
Method Property Fluent Description Representation
Return Value a Vector2

SpriteTask.setUVPixels

Set this texture UV offset, in pixels, based on the texture's dimension
overload 1:
SpriteTask:setUVPixels(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:setUVPixels(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a SpriteTask

SpriteTask.getVertices

Returns a table with all 4 vertices of this sprite
Changing the values through other functions will reset those vertices
overload 1:
SpriteTask:getVertices()
Method Property Fluent Description Representation
Return Value a table

SpriteTask.setTexture

Sets this task's texture
The texture's width and height must be provided if the texture is a location
For custom textures,
the dimensions are optional
overload 1:
SpriteTask:setTexture(textureLocation, width, height)
Method Property Fluent Description Representation
textureLocation accepts a String
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask
overload 2:
SpriteTask:setTexture(texture)
Method Property Fluent Description Representation
texture accepts a Texture
Return Value a SpriteTask
overload 3:
SpriteTask:setTexture(texture, width, height)
Method Property Fluent Description Representation
texture accepts a Texture
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.setDimensions

Sets the texture dimensions, used in UV calculation
overload 1:
SpriteTask:setDimensions(dimensions)
Method Property Fluent Description Representation
dimensions accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:setDimensions(width, height)
Method Property Fluent Description Representation
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.getRenderType

Gets the name of the current render type for this sprite
overload 1:
SpriteTask:getRenderType()
Method Property Fluent Description Representation
Return Value a String

SpriteTask.setRenderType

Sets the current render type of this sprite
TRANSLUCENT by default
Check the docs enum command for all render types
overload 1:
SpriteTask:setRenderType(renderType)
Method Property Fluent Description Representation
renderType accepts a String
Return Value a SpriteTask

SpriteTask.getTexture

Returns this task's current texture
overload 1:
SpriteTask:getTexture()
Method Property Fluent Description Representation
Return Value a String

SpriteTask.getColor

Gets the current color multiplier of this sprite
Values are RGBA from 0 to 1
overload 1:
SpriteTask:getColor()
Method Property Fluent Description Representation
Return Value a Vector4

SpriteTask.getName

Inherited from RenderTask

Get this task's name
overload 1:
SpriteTask:getName()
Method Property Fluent Description Representation
Return Value a String

SpriteTask.remove

Inherited from RenderTask

Removes this render task from the parent model part
overload 1:
SpriteTask:remove()
Method Property Fluent Description Representation
Return Value a RenderTask

SpriteTask.setScale

Inherited from RenderTask

Sets the scale of the task, relative to its attached part
overload 1:
SpriteTask:setScale(scale)
Method Property Fluent Description Representation
scale accepts a Vector3
Return Value a RenderTask
overload 2:
SpriteTask:setScale(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a RenderTask

SpriteTask.isVisible

Inherited from RenderTask

Checks if this task is visible
overload 1:
SpriteTask:isVisible()
Method Property Fluent Description Representation
Return Value a Boolean

SpriteTask.getPos

Inherited from RenderTask

Gets this task position
overload 1:
SpriteTask:getPos()
Method Property Fluent Description Representation
Return Value a Vector3

SpriteTask.getRot

Inherited from RenderTask

Gets this task rotation
overload 1:
SpriteTask:getRot()
Method Property Fluent Description Representation
Return Value a Vector3

SpriteTask.setPos

Inherited from RenderTask

Sets the position of the task, relative to its attached part
Uses model coordinates
overload 1:
SpriteTask:setPos(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a RenderTask
overload 2:
SpriteTask:setPos(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a RenderTask

SpriteTask.setMatrix

Inherited from RenderTask

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
overload 1:
SpriteTask:setMatrix(matrix)
Method Property Fluent Description Representation
matrix accepts a Matrix4
Return Value a RenderTask

SpriteTask.setRot

Inherited from RenderTask

Sets the rotation of the task, relative to its attached part
overload 1:
SpriteTask:setRot(rot)
Method Property Fluent Description Representation
rot accepts a Vector3
Return Value a RenderTask
overload 2:
SpriteTask:setRot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a RenderTask

SpriteTask.getNormalMatrix

Inherited from RenderTask

Recalculates the normal matrix for this render task, based on its current position, rotation, scale, and pivot, then returns this matrix
overload 1:
SpriteTask:getNormalMatrix()
Method Property Fluent Description Representation
Return Value a Matrix3

SpriteTask.getNormalMatrixRaw

Inherited from RenderTask

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
overload 1:
SpriteTask:getNormalMatrixRaw()
Method Property Fluent Description Representation
Return Value a Matrix3

SpriteTask.getPositionMatrix

Inherited from RenderTask

Recalculates the matrix for this render task, based on its current position, rotation, scale, and pivot, then returns this matrix
overload 1:
SpriteTask:getPositionMatrix()
Method Property Fluent Description Representation
Return Value a Matrix4

SpriteTask.getLight

Inherited from RenderTask

Returns the light override value of this task
overload 1:
SpriteTask:getLight()
Method Property Fluent Description Representation
Return Value a Vector2

SpriteTask.setOverlay

Inherited from RenderTask

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:
SpriteTask:setOverlay(overlay)
Method Property Fluent Description Representation
overlay accepts a Vector2
Return Value a RenderTask
overload 2:
SpriteTask:setOverlay(whiteOverlay, hurtOverlay)
Method Property Fluent Description Representation
whiteOverlay accepts an Integer
hurtOverlay accepts an Integer
Return Value a RenderTask

SpriteTask.setLight

Inherited from RenderTask

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:
SpriteTask:setLight(light)
Method Property Fluent Description Representation
light accepts a Vector2
Return Value a RenderTask
overload 2:
SpriteTask:setLight(blockLight, skyLight)
Method Property Fluent Description Representation
blockLight accepts an Integer
skyLight accepts an Integer
Return Value a RenderTask

SpriteTask.getOverlay

Inherited from RenderTask

Returns the overlay override value of this task
overload 1:
SpriteTask:getOverlay()
Method Property Fluent Description Representation
Return Value a Vector2

SpriteTask.setVisible

Inherited from RenderTask

Sets whether or not this task should be rendered
overload 1:
SpriteTask:setVisible(visible)
Method Property Fluent Description Representation
visible accepts a Boolean
Return Value a RenderTask

SpriteTask.getScale

Inherited from RenderTask

Gets this task scale
overload 1:
SpriteTask:getScale()
Method Property Fluent Description Representation
Return Value a Vector3

SpriteTask.getPositionMatrixRaw

Inherited from RenderTask

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
overload 1:
SpriteTask:getPositionMatrixRaw()
Method Property Fluent Description Representation
Return Value a Matrix4

SpriteTask.size

Sets the width and height used to render this sprite
overload 1:
SpriteTask:size(size)
Method Property Fluent Description Representation
size accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:size(width, height)
Method Property Fluent Description Representation
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.color

Sets a color multiplier for this sprite
Values are RGBA from 0 to 1
Default values are 1,
alpha is optional
overload 1:
SpriteTask:color(rgb)
Method Property Fluent Description Representation
rgb accepts a Vector3
Return Value a SpriteTask
overload 2:
SpriteTask:color(rgba)
Method Property Fluent Description Representation
rgba accepts a Vector4
Return Value a SpriteTask
overload 3:
SpriteTask:color(r, g, b, a)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
a accepts a Number
Return Value a SpriteTask

SpriteTask.region

Sets the texture UV region
Uses its dimensions to calculate the max UV
overload 1:
SpriteTask:region(region)
Method Property Fluent Description Representation
region accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:region(width, height)
Method Property Fluent Description Representation
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.uv

Sets this texture UV offset
The Region and Dimension are used to calculate the end UV
overload 1:
SpriteTask:uv(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:uv(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a SpriteTask

SpriteTask.uvPixels

Set this texture UV offset, in pixels, based on the texture's dimension
overload 1:
SpriteTask:uvPixels(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:uvPixels(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a SpriteTask

SpriteTask.texture

Sets this task's texture
The texture's width and height must be provided if the texture is a location
For custom textures,
the dimensions are optional
overload 1:
SpriteTask:texture(textureLocation, width, height)
Method Property Fluent Description Representation
textureLocation accepts a String
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask
overload 2:
SpriteTask:texture(texture)
Method Property Fluent Description Representation
texture accepts a Texture
Return Value a SpriteTask
overload 3:
SpriteTask:texture(texture, width, height)
Method Property Fluent Description Representation
texture accepts a Texture
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.dimensions

Sets the texture dimensions, used in UV calculation
overload 1:
SpriteTask:dimensions(dimensions)
Method Property Fluent Description Representation
dimensions accepts a Vector2
Return Value a SpriteTask
overload 2:
SpriteTask:dimensions(width, height)
Method Property Fluent Description Representation
width accepts an Integer
height accepts an Integer
Return Value a SpriteTask

SpriteTask.renderType

Sets the current render type of this sprite
TRANSLUCENT by default
Check the docs enum command for all render types
overload 1:
SpriteTask:renderType(renderType)
Method Property Fluent Description Representation
renderType accepts a String
Return Value a SpriteTask

SpriteTask.scale

Inherited from RenderTask

Sets the scale of the task, relative to its attached part
overload 1:
SpriteTask:scale(scale)
Method Property Fluent Description Representation
scale accepts a Vector3
Return Value a RenderTask
overload 2:
SpriteTask:scale(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a RenderTask

SpriteTask.pos

Inherited from RenderTask

Sets the position of the task, relative to its attached part
Uses model coordinates
overload 1:
SpriteTask:pos(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a RenderTask
overload 2:
SpriteTask:pos(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a RenderTask

SpriteTask.matrix

Inherited from RenderTask

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
overload 1:
SpriteTask:matrix(matrix)
Method Property Fluent Description Representation
matrix accepts a Matrix4
Return Value a RenderTask

SpriteTask.rot

Inherited from RenderTask

Sets the rotation of the task, relative to its attached part
overload 1:
SpriteTask:rot(rot)
Method Property Fluent Description Representation
rot accepts a Vector3
Return Value a RenderTask
overload 2:
SpriteTask:rot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a RenderTask

SpriteTask.overlay

Inherited from RenderTask

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:
SpriteTask:overlay(overlay)
Method Property Fluent Description Representation
overlay accepts a Vector2
Return Value a RenderTask
overload 2:
SpriteTask:overlay(whiteOverlay, hurtOverlay)
Method Property Fluent Description Representation
whiteOverlay accepts an Integer
hurtOverlay accepts an Integer
Return Value a RenderTask

SpriteTask.light

Inherited from RenderTask

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:
SpriteTask:light(light)
Method Property Fluent Description Representation
light accepts a Vector2
Return Value a RenderTask
overload 2:
SpriteTask:light(blockLight, skyLight)
Method Property Fluent Description Representation
blockLight accepts an Integer
skyLight accepts an Integer
Return Value a RenderTask

SpriteTask.visible

Inherited from RenderTask

Sets whether or not this task should be rendered
overload 1:
SpriteTask:visible(visible)
Method Property Fluent Description Representation
visible accepts a Boolean
Return Value a RenderTask
a a