LCDGFX LCD display driver  1.1.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
NanoObject< T > Class Template Reference

#include <object.h>

Inheritance diagram for NanoObject< T >:
Collaboration diagram for NanoObject< T >:

Public Member Functions

 NanoObject (const NanoPoint &pos)
 
 NanoObject (const NanoPoint &pos, const NanoPoint &size)
 
void draw () override
 
void refresh () override
 
void update () override
 
lcdint_t width () const
 
lcdint_t height () const
 
void moveTo (const NanoPoint &p)
 
void moveBy (const NanoPoint &p)
 
void resize (const NanoPoint &size)
 
void setSize (const NanoPoint &size)
 
void setPos (const NanoPoint &p)
 
const NanoPoint bottom () const
 
const NanoPoint top () const
 
const NanoPoint left () const
 
const NanoPoint right () const
 
const NanoPoint center () const
 
lcdint_t x () const
 
lcdint_t y () const
 
const NanoPointgetPosition () const
 
const NanoRectgetRect () const
 
- Public Member Functions inherited from NanoEngineObject< T >
void focus ()
 
void defocus ()
 
bool isFocused ()
 
bool hasTiler ()
 
T & getTiler ()
 

Protected Attributes

NanoRect m_rect
 
- Protected Attributes inherited from NanoEngineObject< T >
T * m_tiler = nullptr
 Active tiler, assigned to the NanoEngineObject.
 
NanoEngineObject< T > * m_next = nullptr
 Next NanoEngineObject in the list.
 

Friends

template<class N >
class NanoObjectList
 

Additional Inherited Members

- Protected Member Functions inherited from NanoEngineObject< T >
void setTiler (T *tiler)
 

Detailed Description

template<class T>
class NanoObject< T >

This is base class for all NanoObjects.

Definition at line 49 of file object.h.

Constructor & Destructor Documentation

◆ NanoObject() [1/2]

template<class T>
NanoObject< T >::NanoObject ( const NanoPoint pos)
inlineexplicit

Creates basic object with the size [1,1]

Parameters
poslocation of the NanoObject being created

Definition at line 58 of file object.h.

◆ NanoObject() [2/2]

template<class T>
NanoObject< T >::NanoObject ( const NanoPoint pos,
const NanoPoint size 
)
inline

Creates basic object with arbitrary size

Parameters
poslocation of the NanoObject being created
sizedesirable size of NanoObject being created

Definition at line 69 of file object.h.

Member Function Documentation

◆ bottom()

template<class T>
const NanoPoint NanoObject< T >::bottom ( ) const
inline

Returns bottom-center point of the sprite

Definition at line 168 of file object.h.

◆ center()

template<class T>
const NanoPoint NanoObject< T >::center ( ) const
inline

Returns center point of the sprite

Definition at line 200 of file object.h.

◆ draw()

template<class T>
void NanoObject< T >::draw ( )
inlineoverridevirtual

Draws nano object Engine canvas

Implements NanoEngineObject< T >.

Reimplemented in NanoObjectList< T >, NanoSprite< T >, and NanoSprite< GraphicsEngine::TilerT >.

Definition at line 77 of file object.h.

◆ getPosition()

template<class T>
const NanoPoint& NanoObject< T >::getPosition ( ) const
inline

Returns current sprite position (top-left corner)

Definition at line 224 of file object.h.

◆ getRect()

template<class T>
const NanoRect& NanoObject< T >::getRect ( ) const
inline

Returns rectangle area, occupied by the NanoObject

Definition at line 232 of file object.h.

◆ height()

template<class T>
lcdint_t NanoObject< T >::height ( ) const
inline

Returns height of NanoObject

Definition at line 108 of file object.h.

◆ left()

template<class T>
const NanoPoint NanoObject< T >::left ( ) const
inline

Returns left-center point of the sprite

Definition at line 184 of file object.h.

◆ moveBy()

template<class T>
void NanoObject< T >::moveBy ( const NanoPoint p)
inline

Moves sprite to new position by specified offset

Definition at line 126 of file object.h.

◆ moveTo()

template<class T>
void NanoObject< T >::moveTo ( const NanoPoint p)
inline

Moves sprite to new position and marks screen area for refresh

Definition at line 116 of file object.h.

◆ refresh()

template<class T>
void NanoObject< T >::refresh ( )
inlineoverridevirtual

Marks nano object location for refreshing on the new frame

Implements NanoEngineObject< T >.

Reimplemented in NanoObjectList< T >.

Definition at line 82 of file object.h.

◆ resize()

template<class T>
void NanoObject< T >::resize ( const NanoPoint size)
inline

Resizes NanoObject and marks screen area for refresh.

Parameters
sizenew size of NanoObject

Definition at line 138 of file object.h.

◆ right()

template<class T>
const NanoPoint NanoObject< T >::right ( ) const
inline

Returns right-center point of the sprite

Definition at line 192 of file object.h.

◆ setPos()

template<class T>
void NanoObject< T >::setPos ( const NanoPoint p)
inline

Sets position of NanoObject, doesn't mark for update content on the screen

Definition at line 159 of file object.h.

◆ setSize()

template<class T>
void NanoObject< T >::setSize ( const NanoPoint size)
inline

Sets new size of NanoObject. Doesn't update screen content

Parameters
sizenew size of NanoObject

Definition at line 150 of file object.h.

◆ top()

template<class T>
const NanoPoint NanoObject< T >::top ( ) const
inline

Returns top-center point of the sprite

Definition at line 176 of file object.h.

◆ update()

template<class T>
void NanoObject< T >::update ( )
inlineoverridevirtual

Updates NanoObject

Implements NanoEngineObject< T >.

Reimplemented in NanoObjectList< T >.

Definition at line 93 of file object.h.

◆ width()

template<class T>
lcdint_t NanoObject< T >::width ( ) const
inline

Returns width of NanoObject

Definition at line 100 of file object.h.

◆ x()

template<class T>
lcdint_t NanoObject< T >::x ( ) const
inline

Returns sprite x position

Definition at line 208 of file object.h.

◆ y()

template<class T>
lcdint_t NanoObject< T >::y ( ) const
inline

Returns sprite y position

Definition at line 216 of file object.h.

Member Data Documentation

◆ m_rect

template<class T>
NanoRect NanoObject< T >::m_rect
protected

Rectangle area occupied by the object

Definition at line 239 of file object.h.


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