SpriteRenderΒΆ

Inherited: Renderable

DescriptionΒΆ

The SpriteRender component allows you to display images as sprites to use in both 2D and 3D scenes.

Public MethodsΒΆ

float

blendShapeWeight (size_t index) const

Vector4

color () const

int

drawMode () const

int

layer () const

void

setBlendShapeWeight (size_t index, float weight)

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)

Vector2

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ΒΆ

float SpriteRender::blendShapeWeight (size_t index) const

Returns weight of a blend shape with specified index.

See also setBlendShapeWeight().


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::setBlendShapeWeight (size_t index, float weight)

Sets the weight of a blend shape with specified index for this renderer.

See also blendShapeWeight().


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().