FabGL
ESP32 VGA Controller and Graphics Library

◆ setSprites()

template<typename T >
void fabgl::VGAControllerClass::setSprites ( T *  sprites,
int  count 
)
inline

Set the list of active sprites.

A sprite is an image that keeps background unchanged. There is no limit to the number of active sprites, but flickering and slow refresh happens when a lot of sprites (or large sprites) are visible. To empty the list of active sprites call VGAControllerClass.removeSprites().

Parameters
spritesThe list of sprites to make currently active.
countNumber of sprites in the list.

Example:

// define a sprite with user data (velX and velY)
struct MySprite : Sprite {
  int  velX;
  int  velY;
};

static MySprite sprites[10];

VGAController.setSprites(sprites, 10);