You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is not an issue but more of an enhancement for consideration.
I've been using the following new Method (called "created") for the TFT_eSprite Class, that I think others may find useful:
/***************************************************************************************
** Function name: created
** Description: Return the creation status of the Sprite
****************************************************************************************/
bool TFT_eSprite::created(void)
{
if (_created) return true;
else return false;
}
Here's an example of how I use it within a function. Here "ImageToSprite" loads a BMP file into a Sprite that was defined earlier. The pointer to the Sprite is passed:
ImageToSprite("woof.bmp", &spr01)
Within the function the existence of the Sprite is checked before proceeding with the rest of the function:
New function added:
bool created(void);
to check if sprite has been rotated. Example:
if ( !spr.created() ) Serial.println("Sprite has not been created");
Hi, this is not an issue but more of an enhancement for consideration.
I've been using the following new Method (called "created") for the TFT_eSprite Class, that I think others may find useful:
Here's an example of how I use it within a function. Here "ImageToSprite" loads a BMP file into a Sprite that was defined earlier. The pointer to the Sprite is passed:
ImageToSprite("woof.bmp", &spr01)
Within the function the existence of the Sprite is checked before proceeding with the rest of the function:
In summary, this provides a way to place some error checking in your code.
Cheers
The text was updated successfully, but these errors were encountered: