nomlib
Loading...
Searching...
No Matches
nom::Transformable Class Reference
Inheritance diagram for nom::Transformable:
[legend]

Public Types

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 IObjectraw_ptr

Public Member Functions

 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_position (const Point2i &coords)
 Set the positioning – X & Y rendering coordinates – of the object.
virtual void set_size (const Size2i &size)
 Set the size dimensions– width & height rendering coordinates of the object.
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.
virtual void update (void)=0
virtual void draw (RenderTarget &) const =0
 Render the object onto the primary video buffer – your visible screen.
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.

Private Attributes

Point2i position_
Size2i size_
 The dimensions representing width and height.

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

Detailed Description

Definition at line 40 of file Transformable.hpp.

Member Typedef Documentation

◆ self_type

typedef Transformable nom::Transformable::self_type

Definition at line 43 of file Transformable.hpp.

Member Function Documentation

◆ set_bounds()

virtual void nom::Transformable::set_bounds ( const IntRect & bounds)
virtual

Set the complete bounds of the object – position (X, Y) and size (width and height) dimensions.

Reimplemented in nom::Decorator.

◆ set_position() [1/2]

virtual void nom::Transformable::set_position ( const Point2i & coords)
virtual

Set the positioning – X & Y rendering coordinates – of the object.

Remarks
You will almost always want to call the base class – Transformable::set_position and Transformable::set_size – when overriding any of the class methods. See nom::Gradient and nom::Text for examples of why you might need to override the methods here.

Reimplemented in nom::Gradient, nom::Sprite, and nom::Text.

◆ set_position() [2/2]

void nom::Transformable::set_position ( int x,
int y )
Todo
Remove this method; it causes trouble in paradise when we need to overload the virtual set_position method – we unsuspectingly go through the wrong interface.

◆ set_size() [1/2]

virtual void nom::Transformable::set_size ( const Size2i & size)
virtual

Set the size dimensions– width & height rendering coordinates of the object.

Remarks
You will almost always want to call the base class – Transformable::set_position and Transformable::set_size – when overriding any of the class methods. See nom::Gradient and nom::Text for examples of why you might need to override the methods here.

Reimplemented in nom::Gradient, and nom::Sprite.

◆ set_size() [2/2]

void nom::Transformable::set_size ( int w,
int h )
Todo
Remove this method; it causes trouble in paradise when we need to overload the virtual set_position method – we unsuspectingly go through the wrong interface.

◆ translate()

virtual void nom::Transformable::translate ( const Point2i & pos)
virtual
Parameters
posThe offset to add onto the stored position.

◆ type()

ObjectTypeInfo nom::Transformable::type ( ) const
overridevirtual

Re-implements the IObject::type method.

Remarks
This uniquely identifies the object's type.

Reimplemented from nom::IDrawable.

Member Data Documentation

◆ position_

Point2i nom::Transformable::position_
private

Definition at line 101 of file Transformable.hpp.

◆ size_

Size2i nom::Transformable::size_
private

The dimensions representing width and height.

Definition at line 104 of file Transformable.hpp.


The documentation for this class was generated from the following file: