Skip to content

Commit

Permalink
#682 Add created() function for sprites
Browse files Browse the repository at this point in the history
New function added:
  bool created(void);
to check if sprite has been rotated. Example:

if ( !spr.created() ) Serial.println("Sprite has not been created");
  • Loading branch information
Bodmer committed Jul 6, 2020
1 parent 8fc52dc commit a6d50ea
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 6 deletions.
10 changes: 10 additions & 0 deletions Extensions/Sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Extensions/Sprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion TFT_eSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/320 x 240/TFT_Matrix/TFT_Matrix.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"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":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
Expand Down

0 comments on commit a6d50ea

Please sign in to comment.