SpriteRender¶
Inherited: None
Description¶
The SpriteRender component allows you to display images as sprites to use in both 2D and 3D scenes.
Public Methods¶
color () const |
|
int |
drawMode () const |
int |
layer () const |
void |
setColor (const Vector4 & color) |
void |
setDrawMode (int mode) |
void |
setLayer (int layer) |
void |
setSize (const Vector2 & size) |
void |
setSprite (Sprite * sprite) |
void |
setTexture (Texture * texture) |
size () const |
|
Sprite * |
sprite () const |
Texture * |
texture () const |
Public Enums¶
enum SpriteRender::DrawMode
Constant |
Value |
Description |
SpriteRender::Simple |
0 |
The SpriteRender will draw sprite as is. |
SpriteRender::Sliced |
1 |
The SpriteRender will respect 9 patch slicing rules for the size property. |
SpriteRender::Tiled |
2 |
The SpriteRender will duplicate sprites to fill the size property rectangle. |
Static Methods¶
None
Methods Description¶
Vector4 SpriteRender::color () const
Returns the color of the sprite to be drawn.
See also setColor().
int SpriteRender::drawMode () const
Returns a draw mode for the sprite. Please check SpriteRender::DrawMode for more details.
See also setDrawMode().
int SpriteRender::layer () const
Returns the redering layer for the sprite.
See also setLayer().
void SpriteRender::setColor (Vector4 & color)
Changes the color of the sprite to be drawn.
See also color().
void SpriteRender::setDrawMode (int mode)
Sets a draw mode for the sprite. Please check SpriteRender::DrawMode for more details.
See also drawMode().
void SpriteRender::setLayer (int layer)
Sets the redering layer for the sprite.
See also layer().
void SpriteRender::setSize (Vector2 & size)
Sets a new size of sprite.
See also size().
void SpriteRender::setSprite (Sprite * sprite)
Replaces current sprite with a new one.
See also sprite().
void SpriteRender::setTexture (Texture * texture)
Replaces current texture with a new one.
See also texture().
Vector2 SpriteRender::size () const
Returns size of sprite.
See also setSize().
Sprite * SpriteRender::sprite () const
Returns a sprite sheet.
See also setSprite().
Texture * SpriteRender::texture () const
Returns current assigned texture.
See also setTexture().