5#ifndef DUALIE_SPRITE_HPP
6#define DUALIE_SPRITE_HPP
8#include <Dualie/Graphics/Transformable.hpp>
9#include <Dualie/Graphics/Drawable.hpp>
10#include <Dualie/Graphics/SpriteSheet.hpp>
22 C2D_Sprite m_sprite{};
91 void rotate(
const float &rotationOffset);
95 friend C2D_SpriteSheet SpriteSheet::getSpriteSheet();
The base class for any object that can be drawn to the screen.
Definition Drawable.hpp:15
A class used to load and contain t3x formatted spritesheets.
Definition SpriteSheet.hpp:17
A class used to handle the drawing and transformation of sprites.
Definition Sprite.hpp:20
void loadFromSpriteSheet(SpriteSheet spriteSheet, size_t index)
Loads an image into the sprite from a spritesheet.
Definition Sprite.cpp:51
void setOrigin(const dl::Vector2f &origin)
Sets the rotation of the sprite in radians.
Definition Sprite.cpp:56
void rotate(const float &rotationOffset)
Rotates the sprite on top of its current rotation.
Definition Sprite.cpp:30
const float & getRotation()
Definition Sprite.cpp:38
void setRotation(const float &rotation)
Sets the rotation of the sprite.
Definition Sprite.cpp:24
void setPosition(const dl::Vector2f &position) override
Sets the position of the sprite.
Definition Sprite.cpp:14
void move(const dl::Vector2f &offset) override
Moves the sprite offset number of pixels.
Definition Sprite.cpp:19
void draw(const dl::Vector2f &viewOffset) override
Draws the drawable to the screen.
Definition Sprite.cpp:44
const dl::Vector2f & getOrigin()
Definition Sprite.cpp:66