#682 Add created() function for sprites

New function added:
  bool created(void);
to check if sprite has been rotated. Example:

if ( !spr.created() ) Serial.println("Sprite has not been created");
This commit is contained in:
Bodmer committed 2020-07-07 00:52:55 +01:00
1 parent 8fc52dc1f5
commit a6d50ea5ef
8 files changed
+18 -6

No files matched your search

+10
View File
@@ -112,6 +112,16 @@ void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames)
}
/***************************************************************************************
** Function name: created
** Description: Returns true is sprite has been created
*************************************************************************************x*/
bool TFT_eSprite::created(void)
{
return _created;
}
/***************************************************************************************
** Function name: ~TFT_eSprite
** Description: Class destructor
+3
View File
@@ -22,6 +22,9 @@ class TFT_eSprite : public TFT_eSPI {
void* createSprite(int16_t width, int16_t height, uint8_t frames = 1);
// Returns true if sprite has been created
bool created(void);
// Delete the sprite to free up the RAM
void deleteSprite(void);