Commit a6d50ea5 authored by Bodmer's avatar Bodmer

#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");
parent 8fc52dc1
......@@ -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
......
......@@ -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);
......
......@@ -16,7 +16,7 @@
#ifndef _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
......
......@@ -32,7 +32,7 @@ void setup() {
Serial.begin(115200);
randomSeed(analogRead(A0));
tft.init();
tft.setRotation(2);
tft.setRotation(0);
tft.fillScreen(ILI9341_BLACK);
setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
}
......
......@@ -6,7 +6,7 @@
// parallel TFT's (tested with ILI9341 and ILI9481)
// 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:
// https://github.com/Bodmer/TFT_eSPI
......
......@@ -31,7 +31,6 @@
//====================================================================================
// Libraries
//====================================================================================
// Call up the SPIFFS FLASH filing system this is part of the ESP Core
#include <TFT_eSPI.h> // Hardware-specific library
......
{
"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",
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
"repository":
......
name=TFT_eSPI
version=2.2.13
version=2.2.14
author=Bodmer
maintainer=Bodmer
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment