- nom
- Sprite
Base class for bitmap objects. More...
#include <Sprite.hpp>
Public Member Functions | |
| Sprite (void) | |
| Sprite (int32 width, int32 height) | |
| Construct a Sprite object, initializing the width & height coordinates. | |
| Sprite & | operator= (const Sprite &other) |
| Copy assignment operator. | |
| virtual | ~Sprite (void) |
| Destructor. | |
| const Point2i | size (void) const |
| const Point2i | position (void) const |
| uint32 | getState (void) const |
| Get the object's state. | |
| void | setState (uint32 state) |
| Set a new state. | |
| bool | load (const std::string &filename, const Color &colorkey, bool use_cache=false) |
| Load a new image onto the Sprite. | |
| virtual void | update (void) |
| void | draw (RenderTarget target) const |
| Render the object onto the primary video buffer – your visible screen. | |
| void | draw (RenderTarget target, const double angle) const |
| bool | resize (enum ResizeAlgorithm scaling_algorithm) |
| Rescale the font with a chosen resizing algorithm. | |
| bool | resize (const Point2f &scale_factor) |
Public Member Functions inherited from nom::Transformable | |
| Transformable (const Coords &coords) | |
| Transformable (const Coords &coords, const Color &color) | |
| const Coords | getPosition (void) const |
| const Coords | getSize (void) const |
| void | setPosition (int32 x, int32 y) |
| void | setPosition (int32 x, int32 y, int32 width, int32 height) |
| void | setPosition (const Coords &coords) |
| void | setSize (int32 width, int32 height) |
| void | setSize (const Coords &size) |
| void | move (uint32 x=0, uint32 y=0) |
| void | move (const Coords &offsets=Coords(0, 0)) |
| const Color & | getColor (void) const |
| void | setColor (uint8 red, uint8 green, uint8 blue, uint8 alpha=255) |
| void | setColor (const Color &color) |
Public Member Functions inherited from nom::IDrawable | |
| IDrawable (void) | |
| Do nothing at all default constructor. | |
| virtual | ~IDrawable (void) |
| Do nothing at all destructor. | |
Protected Attributes | |
| Texture | sprite |
| Object that holds our sprite image. | |
| uint32 | state |
| Convenience instance variable (user-defined) | |
| int32 | scale_factor |
| Scale factor applied if the resize method is called. | |
Protected Attributes inherited from nom::Transformable | |
| Coords | coords |
| Color | color |
Additional Inherited Members | |
Public Types inherited from nom::IDrawable | |
|
typedef std::unique_ptr < IDrawable > | UniquePtr |
| std::unique_ptr definition type for your convenience, sir! | |
|
typedef std::shared_ptr < IDrawable > | SharedPtr |
| std::shared_ptr definition type at your leisure, sir! | |
|
typedef std::vector < std::shared_ptr< IDrawable > > | SharedDrawables |
| Vector of std::shared_ptr definition type for the brotherhood, sir! | |
|
typedef std::vector < std::unique_ptr< IDrawable > > | UniqueDrawables |
| std::unique_ptr vector container type | |
| typedef const Window & | RenderTarget |
Base class for bitmap objects.
Definition at line 46 of file Sprite.hpp.
| nom::Sprite::Sprite | ( | void | ) |
Default construct for initializing instance variables to their respective defaults.
Definition at line 33 of file Sprite.cpp.
| void nom::Sprite::draw | ( | RenderTarget | target, |
| const double | angle | ||
| ) | const |
Draw a rotated nom::Sprite on a nom::Window
| target | Reference to an active nom::Window |
| angle | Rotation angle in degrees |
Definition at line 116 of file Sprite.cpp.
|
virtual |
Intended to be used internally by the class re-implementing this method; for use in preparing the buffer to be drawn using the draw method call. Whereas both Update & Draw are typically publicly exposed to the end-user, only the Draw method call should be expected of the end-user to be explicitly called.
Implements nom::IDrawable.
Reimplemented in nom::SpriteBatch.
Definition at line 104 of file Sprite.cpp.