Skip to content

Commit a6d50ea

Browse files
committed
#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");
1 parent 8fc52dc commit a6d50ea

File tree

8 files changed

+18
-6
lines changed

8 files changed

+18
-6
lines changed

Extensions/Sprite.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames)
112112
}
113113

114114

115+
/***************************************************************************************
116+
** Function name: created
117+
** Description: Returns true is sprite has been created
118+
*************************************************************************************x*/
119+
bool TFT_eSprite::created(void)
120+
{
121+
return _created;
122+
}
123+
124+
115125
/***************************************************************************************
116126
** Function name: ~TFT_eSprite
117127
** Description: Class destructor

Extensions/Sprite.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class TFT_eSprite : public TFT_eSPI {
2222

2323
void* createSprite(int16_t width, int16_t height, uint8_t frames = 1);
2424

25+
// Returns true if sprite has been created
26+
bool created(void);
27+
2528
// Delete the sprite to free up the RAM
2629
void deleteSprite(void);
2730

TFT_eSPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef _TFT_eSPIH_
1717
#define _TFT_eSPIH_
1818

19-
#define TFT_ESPI_VERSION "2.2.13"
19+
#define TFT_ESPI_VERSION "2.2.14"
2020

2121
/***************************************************************************************
2222
** Section 1: Load required header files

examples/320 x 240/TFT_Matrix/TFT_Matrix.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void setup() {
3232
Serial.begin(115200);
3333
randomSeed(analogRead(A0));
3434
tft.init();
35-
tft.setRotation(2);
35+
tft.setRotation(0);
3636
tft.fillScreen(ILI9341_BLACK);
3737
setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
3838
}

examples/DMA test/SpriteRotatingCube/SpriteRotatingCube.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// parallel TFT's (tested with ILI9341 and ILI9481)
77

88
// The sketch will run on processors without DMA and also parallel
9-
// interface TFT's. Comment out line 25 for no DMA.
9+
// interface TFT's. Comment out line 29 for no DMA.
1010

1111
// Library here:
1212
// https://github.com/Bodmer/TFT_eSPI

examples/Smooth Fonts/FLASH_Array/Unicode_test/Unicode_test.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
//====================================================================================
3232
// Libraries
3333
//====================================================================================
34-
// Call up the SPIFFS FLASH filing system this is part of the ESP Core
3534

3635
#include <TFT_eSPI.h> // Hardware-specific library
3736

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TFT_eSPI",
3-
"version": "2.2.13",
3+
"version": "2.2.14",
44
"keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140",
55
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
66
"repository":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=TFT_eSPI
2-
version=2.2.13
2+
version=2.2.14
33
author=Bodmer
44
maintainer=Bodmer
55
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32

0 commit comments

Comments
 (0)