nCine::Sprite class

Scene node representing a regular sprite.

Base classes

class BaseSprite
Base class for sprites.

Derived classes

class AnimatedSprite
Animated sprite.
class Particle
Renders a single particle.

Public static functions

static auto sType() -> ObjectType

Constructors, destructors, conversion operators

Sprite()
Default constructor for a sprite with no parent and no texture, positioned in the origin.
Sprite(SceneNode* parent, Texture* texture)
Constructor for a sprite with a parent and texture, positioned in the relative origin.
Sprite(Texture* texture) explicit
Constructor for a sprite with a texture but no parent, positioned in the origin.
Sprite(SceneNode* parent, Texture* texture, float xx, float yy)
Constructor for a sprite with a parent, a texture and a specified relative position.
Sprite(SceneNode* parent, Texture* texture, Vector2f position)
Constructor for a sprite with a parent, a texture and a specified relative position as a vector.
Sprite(Texture* texture, float xx, float yy)
Constructor for a sprite with a texture and a specified position but no parent.
Sprite(Texture* texture, Vector2f position)
Constructor for a sprite with a texture and a specified position as a vector but no parent.
Sprite(Sprite&&) defaulted
Default move constructor.
Sprite(const Sprite& other) protected
Protected copy constructor used to clone objects.

Public functions

auto operator=(Sprite&&) -> Sprite& defaulted
Default move assignment operator.
auto clone() const -> Sprite
Returns a copy of this object.

Protected functions

void textureHasChanged(Texture* newTexture) override
Performs the required tasks upon a change to the texture.