mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-11 08:34:45 +02:00
#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:
@@ -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
|
** Function name: ~TFT_eSprite
|
||||||
** Description: Class destructor
|
** Description: Class destructor
|
||||||
|
@@ -22,6 +22,9 @@ class TFT_eSprite : public TFT_eSPI {
|
|||||||
|
|
||||||
void* createSprite(int16_t width, int16_t height, uint8_t frames = 1);
|
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
|
// Delete the sprite to free up the RAM
|
||||||
void deleteSprite(void);
|
void deleteSprite(void);
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#ifndef _TFT_eSPIH_
|
#ifndef _TFT_eSPIH_
|
||||||
#define _TFT_eSPIH_
|
#define _TFT_eSPIH_
|
||||||
|
|
||||||
#define TFT_ESPI_VERSION "2.2.13"
|
#define TFT_ESPI_VERSION "2.2.14"
|
||||||
|
|
||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
** Section 1: Load required header files
|
** Section 1: Load required header files
|
||||||
|
@@ -32,7 +32,7 @@ void setup() {
|
|||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
randomSeed(analogRead(A0));
|
randomSeed(analogRead(A0));
|
||||||
tft.init();
|
tft.init();
|
||||||
tft.setRotation(2);
|
tft.setRotation(0);
|
||||||
tft.fillScreen(ILI9341_BLACK);
|
tft.fillScreen(ILI9341_BLACK);
|
||||||
setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
|
setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// parallel TFT's (tested with ILI9341 and ILI9481)
|
// parallel TFT's (tested with ILI9341 and ILI9481)
|
||||||
|
|
||||||
// The sketch will run on processors without DMA and also parallel
|
// The sketch will run on processors without DMA and also parallel
|
||||||
// interface TFT's. Comment out line 25 for no DMA.
|
// interface TFT's. Comment out line 29 for no DMA.
|
||||||
|
|
||||||
// Library here:
|
// Library here:
|
||||||
// https://github.com/Bodmer/TFT_eSPI
|
// https://github.com/Bodmer/TFT_eSPI
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
//====================================================================================
|
//====================================================================================
|
||||||
// Libraries
|
// Libraries
|
||||||
//====================================================================================
|
//====================================================================================
|
||||||
// Call up the SPIFFS FLASH filing system this is part of the ESP Core
|
|
||||||
|
|
||||||
#include <TFT_eSPI.h> // Hardware-specific library
|
#include <TFT_eSPI.h> // Hardware-specific library
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "TFT_eSPI",
|
"name": "TFT_eSPI",
|
||||||
"version": "2.2.13",
|
"version": "2.2.14",
|
||||||
"keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140",
|
"keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140",
|
||||||
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
|
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
|
||||||
"repository":
|
"repository":
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name=TFT_eSPI
|
name=TFT_eSPI
|
||||||
version=2.2.13
|
version=2.2.14
|
||||||
author=Bodmer
|
author=Bodmer
|
||||||
maintainer=Bodmer
|
maintainer=Bodmer
|
||||||
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32
|
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32
|
||||||
|
Reference in New Issue
Block a user