LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
NanoObject< T > Class Template Reference

This is base class for all NanoObjects. More...

#include <object.h>

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

Public Member Functions

 NanoObject (const NanoPoint &pos)
 Creates basic object with the size [1,1]. More...
 
 NanoObject (const NanoPoint &pos, const NanoPoint &size)
 Creates basic object with arbitrary size. More...
 
void draw () override
 Draws nano object Engine canvas.
 
void refresh () override
 Marks nano object location for refreshing on the new frame.
 
void update () override
 Updates NanoObject.
 
lcdint_t width () const
 Returns width of NanoObject.
 
lcdint_t height () const
 Returns height of NanoObject.
 
void moveTo (const NanoPoint &p)
 Moves sprite to new position and marks screen area for refresh.
 
void moveBy (const NanoPoint &p)
 Moves sprite to new position by specified offset.
 
void resize (const NanoPoint &size)
 Resizes NanoObject and marks screen area for refresh. More...
 
void setSize (const NanoPoint &size)
 Sets new size of NanoObject. More...
 
void setPos (const NanoPoint &p)
 Sets position of NanoObject, doesn't mark for update content on the screen.
 
const NanoPoint bottom () const
 Returns bottom-center point of the sprite.
 
const NanoPoint top () const
 Returns top-center point of the sprite.
 
const NanoPoint left () const
 Returns left-center point of the sprite.
 
const NanoPoint right () const
 Returns right-center point of the sprite.
 
const NanoPoint center () const
 Returns center point of the sprite.
 
lcdint_t x () const
 Returns sprite x position.
 
lcdint_t y () const
 Returns sprite y position.
 
const NanoPointgetPosition () const
 Returns current sprite position (top-left corner)
 
const NanoRectgetRect () const
 Returns rectangle area, occupied by the NanoObject.
 
- Public Member Functions inherited from NanoEngineObject< T >
void focus ()
 Sets logic focus on NanoEngineObject.
 
void defocus ()
 Clears logic focus from NanoEngineObject.
 
bool isFocused ()
 Returns true if logic focus points to the object. More...
 
bool hasTiler ()
 Returns true if NanoEngineObject is bound to NanoEngine instance.
 
T & getTiler ()
 Returns reference to NanoEngine. More...
 

Protected Attributes

NanoRect m_rect
 Rectangle area occupied by the object.
 
- 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)
 Bind NanoEngineObject to specific NanoEngine. More...
 

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

◆ 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.

◆ 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.


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