This section explains how to configure and control sprites after they've been created and registered.
You can set the color of a sprite after creating it -- and you're free to change it at any time afterward. To set a sprite's color, use the setSpriteColor function.
- Function Format -Arguments:
RGBA stands for Red, Green, Blue, and Alpha -- the three primary colors of light plus a transparency value.
The alpha value represents the opacity of the color: 0 means fully transparent, and higher values move toward full opacity.
Color blending is done using additive color mixing, which simulates how light behaves -- unlike mixing paints, which uses subtractive blending. For example:
Each sprite has a depth value.
When multiple sprites are rendered together, those with higher depth values appear behind those with lower values. To set a sprite's depth, use the "setSpriteDepth" function.
- Function Format -Arguments:
This function can be used with rectangle sprites, ellipse sprites, text sprites, and image sprites.
To change a sprite's drawing size, use the "setSpriteSize" function.
There are two variations depending on the type of sprite.
Arguments:
Arguments: