SSD1306 OLED display driver  1.8.2
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
Public Member Functions | List of all members
NanoSprite< T, E > Class Template Reference

#include <sprite.h>

Public Member Functions

 NanoSprite (const NanoPoint &pos, const NanoPoint &size, const uint8_t *bitmap)
 
void draw ()
 
void refresh ()
 
void moveTo (const NanoPoint &p)
 
void moveBy (const NanoPoint &p)
 
const NanoPoint bottom () const
 
const NanoPoint top () const
 
const NanoPoint left () const
 
const NanoPoint right () const
 
const NanoPoint center () const
 
void setBitmap (const uint8_t *bitmap)
 
lcdint_t x () const
 
lcdint_t y () const
 

Detailed Description

template<typename T, T & E>
class NanoSprite< T, E >

This is template class for user sprites implementations. NanoSprite can work only as part of NanoEngine, it requires NanoEngine type and NanoEngine instance as arguments.

Definition at line 46 of file sprite.h.

Constructor & Destructor Documentation

◆ NanoSprite()

template<typename T , T & E>
NanoSprite< T, E >::NanoSprite ( const NanoPoint pos,
const NanoPoint size,
const uint8_t *  bitmap 
)
inline

Creates sprite object of variable size. Such sprites can change their size and bitmap content.

Parameters
posposition of the sprite in global coordinates
sizesize of sprite
bitmapsprite content (in flash memory)

Definition at line 56 of file sprite.h.

Member Function Documentation

◆ bottom()

template<typename T , T & E>
const NanoPoint NanoSprite< T, E >::bottom ( ) const
inline

Returns bottom-center point of the sprite

Definition at line 101 of file sprite.h.

◆ center()

template<typename T , T & E>
const NanoPoint NanoSprite< T, E >::center ( ) const
inline

Returns center point of the sprite

Definition at line 133 of file sprite.h.

◆ draw()

template<typename T , T & E>
void NanoSprite< T, E >::draw ( )
inline

Draws monochrome sprite on Engine canvas

Definition at line 65 of file sprite.h.

◆ left()

template<typename T , T & E>
const NanoPoint NanoSprite< T, E >::left ( ) const
inline

Returns left-center point of the sprite

Definition at line 117 of file sprite.h.

◆ moveBy()

template<typename T , T & E>
void NanoSprite< T, E >::moveBy ( const NanoPoint p)
inline

Moves sprite to new position by specified offset

Definition at line 91 of file sprite.h.

◆ moveTo()

template<typename T , T & E>
void NanoSprite< T, E >::moveTo ( const NanoPoint p)
inline

Moves sprite to new position

Definition at line 81 of file sprite.h.

◆ refresh()

template<typename T , T & E>
void NanoSprite< T, E >::refresh ( )
inline

Marks sprite locate for refreshing on the new frame

Definition at line 73 of file sprite.h.

◆ right()

template<typename T , T & E>
const NanoPoint NanoSprite< T, E >::right ( ) const
inline

Returns right-center point of the sprite

Definition at line 125 of file sprite.h.

◆ setBitmap()

template<typename T , T & E>
void NanoSprite< T, E >::setBitmap ( const uint8_t *  bitmap)
inline

Changes sprite bitmap to new one.

Definition at line 141 of file sprite.h.

◆ top()

template<typename T , T & E>
const NanoPoint NanoSprite< T, E >::top ( ) const
inline

Returns top-center point of the sprite

Definition at line 109 of file sprite.h.

◆ x()

template<typename T , T & E>
lcdint_t NanoSprite< T, E >::x ( ) const
inline

Returns sprite x position

Definition at line 149 of file sprite.h.

◆ y()

template<typename T , T & E>
lcdint_t NanoSprite< T, E >::y ( ) const
inline

Returns sprite y position

Definition at line 154 of file sprite.h.


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