nCine::BaseSprite class

Base class for sprites.

Base classes

class DrawableNode
Object that can be drawn through the render queue.

Derived classes

class Jazz2::Actors::ActorBase::ActorRenderer
Actor renderer.
class MeshSprite
A scene node representing a mesh with vertices and UVs.
class Sprite
Scene node representing a regular sprite.

Constructors, destructors, conversion operators

BaseSprite(BaseSprite&&) defaulted
BaseSprite(SceneNode* parent, Texture* texture, float xx, float yy) protected
Protected constructor accessible only by derived sprite classes.
BaseSprite(SceneNode* parent, Texture* texture, Vector2f position) protected
Protected constructor accessible only by derived sprite classes.
BaseSprite(const BaseSprite& other) protected
Protected copy constructor used to clone objects.

Public functions

auto operator=(BaseSprite&&) -> BaseSprite& defaulted
void setSize(float width, float height)
Sets sprite size.
void setSize(Vector2f size)
Sets sprite size with a Vector2f
auto texture() const -> const Texture*
Gets the texture object.
void setTexture(Texture* texture)
Sets the texture object.
void resetTexture()
Triggers a texture update without setting a new texture.
auto texRect() const -> Recti
Gets the texture source rectangle for blitting.
void setTexRect(const Recti& rect)
Sets the texture source rectangle for blitting.
auto isFlippedX() const -> bool
Returns true if the sprite texture is horizontally flipped.
void setFlippedX(bool flippedX)
Flips the texture rect horizontally.
auto isFlippedY() const -> bool
Returns true if the sprite texture is vertically flipped.
void setFlippedY(bool flippedY)
Flips the texture rect vertically.

Protected functions

void shaderHasChanged() override
Performs the required tasks upon a change to the shader.
void textureHasChanged(Texture* newTexture) pure virtual
Performs the required tasks upon a change to the texture.
void updateRenderCommand() override
Updates the render command.
auto operator=(const BaseSprite&) -> BaseSprite& deleted

Protected variables

Texture* texture_
The sprite texture.
Recti texRect_
The texture source rectangle.
bool flippedX_
A flag indicating if the sprite texture is horizontally flipped.
bool flippedY_
A flag indicating if the sprite texture is vertically flipped.
GLUniformBlockCache* instanceBlock_