SSD1306 OLED display driver 1.7.8 This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays

Public Member Functions | Protected Attributes | List of all members
NanoFixedSprite< T, E > Class Template Reference

`#include <sprite.h>`

## Public Member Functions
| NanoFixedSprite (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)
const NanoPoint & | getPosition () const
lcdint_t | x () const
lcdint_t | y () const
const NanoPoint & | pos () const

## Protected Attributes
const NanoPoint | m_size
NanoPoint | m_pos

## Detailed Description

### template<typename T, T & E>
class NanoFixedSprite< T, E >

This is template class for user sprites implementation. It requires NanoEngine type and NanoEngine instance as arguments.

Definition at line 166 of file sprite.h.

## Constructor & Destructor Documentation

## ◆ NanoFixedSprite()

template<typename T , T & E>

NanoFixedSprite< T, E >::NanoFixedSprite | ( | const NanoPoint & | pos,
|  | const NanoPoint & | size,
|  | const uint8_t * | bitmap
| ) |  |
| inline

Creates sprite object of fixed size. Such sprites can change their bitmap content only and position.

Parameters

  pos | position of the sprite in global coordinates
  size | size of sprite
  bitmap | sprite content (in flash memory)

Definition at line 176 of file sprite.h.

## Member Function Documentation

## ◆ bottom()

template<typename T , T & E>

const NanoPoint NanoFixedSprite< T, E >::bottom | ( |  | ) | const
| inline

Returns bottom-center point of the sprite

Definition at line 223 of file sprite.h.

## ◆ center()

template<typename T , T & E>

const NanoPoint NanoFixedSprite< T, E >::center | ( |  | ) | const
| inline

Returns center point of the sprite

Definition at line 255 of file sprite.h.

## ◆ draw()

template<typename T , T & E>

void NanoFixedSprite< T, E >::draw | ( |  | ) |
| inline

Draws monochrome sprite on Engine canvas

Definition at line 186 of file sprite.h.

## ◆ getPosition()

template<typename T , T & E>

const NanoPoint& NanoFixedSprite< T, E >::getPosition | ( |  | ) | const
| inline

Returns current sprite position (top-left corner)

Definition at line 271 of file sprite.h.

## ◆ left()

template<typename T , T & E>

const NanoPoint NanoFixedSprite< T, E >::left | ( |  | ) | const
| inline

Returns left-center point of the sprite

Definition at line 239 of file sprite.h.

## ◆ moveBy()

template<typename T , T & E>

void NanoFixedSprite< T, E >::moveBy | ( | const NanoPoint & | p | ) |
| inline

Moves sprite to new position by specified offset

Definition at line 213 of file sprite.h.

## ◆ moveTo()

template<typename T , T & E>

void NanoFixedSprite< T, E >::moveTo | ( | const NanoPoint & | p | ) |
| inline

Moves sprite to new position

Definition at line 203 of file sprite.h.

## ◆ pos()

template<typename T , T & E>

const NanoPoint& NanoFixedSprite< T, E >::pos | ( |  | ) | const
| inline

Returns current sprite position (top-left corner)

Definition at line 286 of file sprite.h.

## ◆ refresh()

template<typename T , T & E>

void NanoFixedSprite< T, E >::refresh | ( |  | ) |
| inline

Marks sprite locate for refreshing on the new frame

Definition at line 194 of file sprite.h.

## ◆ right()

template<typename T , T & E>

const NanoPoint NanoFixedSprite< T, E >::right | ( |  | ) | const
| inline

Returns right-center point of the sprite

Definition at line 247 of file sprite.h.

## ◆ setBitmap()

template<typename T , T & E>

void NanoFixedSprite< T, E >::setBitmap | ( | const uint8_t * | bitmap | ) |
| inline

Changes sprite bitmap to new one.

Definition at line 263 of file sprite.h.

## ◆ top()

template<typename T , T & E>

const NanoPoint NanoFixedSprite< T, E >::top | ( |  | ) | const
| inline

Returns top-center point of the sprite

Definition at line 231 of file sprite.h.

## ◆ x()

template<typename T , T & E>

lcdint_t NanoFixedSprite< T, E >::x | ( |  | ) | const
| inline

Returns sprite x position

Definition at line 276 of file sprite.h.

## ◆ y()

template<typename T , T & E>

lcdint_t NanoFixedSprite< T, E >::y | ( |  | ) | const
| inline

Returns sprite y position

Definition at line 281 of file sprite.h.

## Member Data Documentation

## ◆ m_pos

template<typename T , T & E>

NanoPoint NanoFixedSprite< T, E >::m_pos
| protected

Sprite position in global (world) coordinates

Definition at line 292 of file sprite.h.

## ◆ m_size

template<typename T , T & E>

const NanoPoint NanoFixedSprite< T, E >::m_size
| protected

fixed size of sprite

Definition at line 290 of file sprite.h.

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

- src/nano_engine/sprite.h