29 #ifndef NOMLIB_SDL2_SPRITE_HPP
30 #define NOMLIB_SDL2_SPRITE_HPP
36 #include "nomlib/config.hpp"
37 #include "nomlib/math/Transformable.hpp"
38 #include "nomlib/math/Rect-inl.hpp"
39 #include "nomlib/math/Point2-inl.hpp"
40 #include "nomlib/graphics/Texture.hpp"
41 #include "nomlib/graphics/Renderer.hpp"
55 Sprite ( int32 width, int32 height );
63 const Point2i size (
void )
const;
64 const Point2i position (
void )
const;
74 const std::string& filename,
75 const Color& colorkey,
76 bool use_cache =
false
79 virtual void update (
void );
90 bool resize (
enum ResizeAlgorithm scaling_algorithm );
108 #endif // include guard defined
int32 scale_factor
Scale factor applied if the resize method is called.
virtual void update(void)
virtual ~Sprite(void)
Destructor.
bool resize(enum ResizeAlgorithm scaling_algorithm)
Rescale the font with a chosen resizing algorithm.
Texture sprite
Object that holds our sprite image.
bool load(const std::string &filename, const Color &colorkey, bool use_cache=false)
Load a new image onto the Sprite.
void draw(RenderTarget target) const
Render the object onto the primary video buffer – your visible screen.
uint32 state
Convenience instance variable (user-defined)
Sprite & operator=(const Sprite &other)
Copy assignment operator.
uint32 getState(void) const
Get the object's state.
void setState(uint32 state)
Set a new state.
Utility class container for RGBA colors.
Base class for bitmap objects.