- nom
- SpriteBatch
Extended bitmap object rendering – utilizes sprite sheets. More...
#include <SpriteBatch.hpp>
Public Member Functions | |
| SpriteBatch (void) | |
| virtual | ~SpriteBatch (void) |
| Destructor. | |
| SpriteBatch (const SpriteSheet &sheet) | |
| SpriteBatch (const std::string &filename) | |
| Construct a SpriteBatch object from an existing sprite sheet filename. | |
| SpriteBatch & | operator= (const SpriteBatch &other) |
| Copy assignment operator. | |
| int32 | getSheetID (void) const |
| Get the object's current sheet_id. | |
| int32 | frames (void) const |
| Obtain the number of frames available. | |
| const std::string & | sheet_filename (void) const |
| void | setSheetID (int32 id) |
| Set a new frame ID to render. | |
| void | update (void) |
Public Member Functions inherited from nom::Sprite | |
| 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. | |
| 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 | |
| Coords | offsets |
| Source (input) coordinates – used for sprite sheet positioning. | |
| SpriteSheet | sprite_sheet |
| Our attached sprite sheet object. | |
| int32 | sheet_id |
| The sheet's frame ID presently in use. | |
Protected Attributes inherited from nom::Sprite | |
| 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 |
Extended bitmap object rendering – utilizes sprite sheets.
Definition at line 44 of file SpriteBatch.hpp.
| nom::SpriteBatch::SpriteBatch | ( | void | ) |
Default construct for initializing instance variables to their respective defaults.
Definition at line 33 of file SpriteBatch.cpp.
| nom::SpriteBatch::SpriteBatch | ( | const SpriteSheet & | sheet | ) |
Construct a SpriteBatch object, initializing it with a SpriteSheet object.
Definition at line 38 of file SpriteBatch.cpp.
|
virtual |
Update the sprite for rendering with regard to positioning coordinates and target frame ID.
Reimplemented from nom::Sprite.
Definition at line 108 of file SpriteBatch.cpp.