![]() |
nomlib
|
Base class for bitmap objects. More...
#include <Sprite.hpp>
Public Types | |
| typedef Sprite | self_type |
| typedef Transformable | derived_class |
| Public Types inherited from nom::Transformable | |
| typedef Transformable | self_type |
| Public Types inherited from nom::IDrawable | |
| typedef IDrawable | self_type |
| typedef self_type * | raw_ptr |
| A type definition for a C pointer – raw pointer – to an IDrawable object. | |
| typedef std::unique_ptr< self_type > | unique_ptr |
| A type definition for a C++11 std::unique_ptr to an IDrawable object. | |
| typedef std::shared_ptr< self_type > | shared_ptr |
| A type definition for a C++11 std::shared_ptr to an IDrawable object. | |
| typedef const RenderWindow | RenderTarget |
| Public Types inherited from nom::IObject | |
| typedef IObject | self_type |
| typedef IObject * | raw_ptr |
Public Member Functions | |
| bool | init_with_color (const Color4i &color, const Size2i &dims) |
| Construct a sprite from a dimension and color. | |
| ObjectTypeInfo | type () const override |
| Re-implements the IObject::type method. | |
| virtual void | set_position (const Point2i &pos) override |
| Re-implements Transformable::set_position. | |
| virtual void | set_size (const Size2i &dims) override |
| Re-implements Transformable::set_size. | |
| std::unique_ptr< Sprite > | clone () const |
| Implements the required IDrawable::clone method. | |
| std::shared_ptr< Texture > | texture () const |
| bool | valid () const |
| Color4i | color () const |
| Get the texture color of the sprite. | |
| BlendMode | color_blend_mode () const |
| Get the color blend mode of the sprite. | |
| uint8 | alpha () const |
| Get the alpha value of the sprite. | |
| bool | set_texture (Texture &tex) |
| Construct a sprite from an existing texture source. | |
| bool | set_texture (Texture *tex) |
| Construct a sprite from an existing texture source. | |
| bool | set_texture (std::shared_ptr< Texture > &tex) |
| Construct a sprite from an existing texture source. | |
| bool | set_alpha (uint8 opacity) |
| bool | set_color (const Color4i &color) |
| bool | set_color_blend_mode (BlendMode blend) |
| void | release_texture () |
| Free the stored texture. | |
| virtual void | draw (RenderTarget &target) const override |
| Render the object onto the primary video buffer – your visible screen. | |
| virtual void | draw (RenderTarget &target, real64 angle) const |
| Public Member Functions inherited from nom::Transformable | |
| Transformable (const Point2i &pos, const Size2i &size) | |
| Transformable (const IntRect &bounds) | |
| Construct an object using a complete set of coordinates (bounds). | |
| ObjectTypeInfo | type () const override |
| Re-implements the IObject::type method. | |
| const Point2i & | position (void) const |
| Getter for stored positioning coordinates. | |
| const Size2i & | size (void) const |
| Getter for stored size dimensions. | |
| virtual void | set_bounds (const IntRect &bounds) |
| Set the complete bounds of the object – position (X, Y) and size (width and height) dimensions. | |
| void | set_position (int x, int y) |
| void | set_size (int w, int h) |
| virtual void | translate (const Point2i &pos) |
| Public Member Functions inherited from nom::IDrawable | |
| IDrawable (void) | |
| Do nothing at all default constructor. | |
| virtual | ~IDrawable (void) |
| Do nothing at all destructor. | |
| Public Member Functions inherited from nom::IObject | |
| IObject (void) | |
| Default constructor. | |
| virtual | ~IObject (void) |
| Virtual destructor. | |
| virtual bool | is_type (const ObjectTypeInfo &rhs) const |
| Compare this object type with another object's type. | |
Protected Attributes | |
| std::shared_ptr< Texture > | texture_ |
| The underlying texture for the sprite. | |
Private Member Functions | |
| virtual void | update () override |
Additional Inherited Members | |
| Static Public Member Functions inherited from nom::IObject | |
| template<typename Base, typename Derived> | |
| static bool | is_a (const Derived object) |
| Compare two objects to determine if a derived class inherits from a base class object. | |
| static void * | operator new (nom::size_type mem) |
| static void | operator delete (void *ptr) |
| Static Public Attributes inherited from nom::IObject | |
| static uint64 | total_alloc_bytes |
| static uint64 | total_dealloc_bytes |
Base class for bitmap objects.
Definition at line 48 of file Sprite.hpp.
| typedef Transformable nom::Sprite::derived_class |
Definition at line 52 of file Sprite.hpp.
| typedef Sprite nom::Sprite::self_type |
Definition at line 51 of file Sprite.hpp.
|
overridevirtual |
Render the object onto the primary video buffer – your visible screen.
Implements nom::IDrawable.
Reimplemented in nom::SpriteBatch.
|
virtual |
Draw a rotated nom::Sprite on a nom::RenderWindow
| target | Reference to an active nom::RenderWindow |
| angle | Rotation angle in degrees |
Reimplemented in nom::SpriteBatch.
| bool nom::Sprite::init_with_color | ( | const Color4i & | color, |
| const Size2i & | dims ) |
Construct a sprite from a dimension and color.
\params color The color to fill the sprite bounds with. \params dims The width and height, in pixels, of the sprite.
| void nom::Sprite::release_texture | ( | ) |
Free the stored texture.
|
overridevirtual |
Re-implements Transformable::set_position.
Reimplemented from nom::Transformable.
|
overridevirtual |
Re-implements Transformable::set_size.
Reimplemented from nom::Transformable.
| bool nom::Sprite::set_texture | ( | std::shared_ptr< Texture > & | tex | ) |
Construct a sprite from an existing texture source.
\params tex An existing, valid nom::Texture pointer.
| bool nom::Sprite::set_texture | ( | Texture & | tex | ) |
Construct a sprite from an existing texture source.
\params tex An existing, valid nom::Texture reference.
| bool nom::Sprite::set_texture | ( | Texture * | tex | ) |
Construct a sprite from an existing texture source.
\params tex An existing, valid nom::Texture pointer.
|
overridevirtual |
Re-implements the IObject::type method.
Reimplemented from nom::IDrawable.
Reimplemented in nom::SpriteBatch.
|
overrideprivatevirtual |
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.
|
protected |
The underlying texture for the sprite.
Definition at line 152 of file Sprite.hpp.