Dev - Lua Libraries
Lua Command: s3sprite.setColor
Parameters
Return Values
void
- no return valuesSignature
Description
Changes the color and transparency of the sprite with the given spriteID.
You can also change the color of all children of the sprite by setting recursive to true. By default no children will be changed.
You can also change the color of all children of the sprite by setting recursive to true. By default no children will be changed.
Example:
Load and image, display it and change the color to a semi-transparent red1
2
3
2
3
cursor = s3sprite.load("interface/cursor.png")
s3sprite.create(cursor, 5, 5)
s3sprite.setColor(cursor, {255, 0, 0, 0.5})
s3sprite.create(cursor, 5, 5)
s3sprite.setColor(cursor, {255, 0, 0, 0.5})