Add setLabelDatum
Adjust label datum and x, y deltas for labels in buttons
This commit is contained in:
parent
ea6c47d928
commit
89101c5554
|
|
@ -70,9 +70,15 @@ void TFT_eSPI_Button::drawButton(bool inverted, String long_name) {
|
||||||
_gfx->setTextDatum(_textdatum);
|
_gfx->setTextDatum(_textdatum);
|
||||||
if (long_name == "")
|
if (long_name == "")
|
||||||
//_gfx->drawString(_label, _x1 + (_w/2), _y1 + (_h/2) -4);
|
//_gfx->drawString(_label, _x1 + (_w/2), _y1 + (_h/2) -4);
|
||||||
|
<<<<<<< HEAD
|
||||||
_gfx->drawString(_label, _x1 + _xd, _y1 + (_h/2) + _yd);
|
_gfx->drawString(_label, _x1 + _xd, _y1 + (_h/2) + _yd);
|
||||||
else
|
else
|
||||||
_gfx->drawString(long_name, _x1 + _xd, _y1 + (_h/2) + _yd);
|
_gfx->drawString(long_name, _x1 + _xd, _y1 + (_h/2) + _yd);
|
||||||
|
=======
|
||||||
|
_gfx->drawString(_label, _x1 + _xd, _y1 + (_h/2));
|
||||||
|
else
|
||||||
|
_gfx->drawString(long_name, _x1 + _xd, _y1 + (_h/2));
|
||||||
|
>>>>>>> 0f793cb... Add setLabelDatum
|
||||||
_gfx->setTextDatum(tempdatum);
|
_gfx->setTextDatum(tempdatum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
19
User_Setup.h
19
User_Setup.h
|
|
@ -129,9 +129,9 @@
|
||||||
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP8266 SETUP ######
|
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP8266 SETUP ######
|
||||||
|
|
||||||
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
|
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
|
||||||
#define TFT_CS PIN_D8 // Chip select control pin D8
|
//#define TFT_CS PIN_D8 // Chip select control pin D8
|
||||||
#define TFT_DC PIN_D3 // Data Command control pin
|
//#define TFT_DC PIN_D3 // Data Command control pin
|
||||||
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
|
||||||
|
|
||||||
//#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin)
|
//#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin)
|
||||||
|
|
@ -164,17 +164,26 @@
|
||||||
// For ESP32 Dev board (only tested with ILI9341 display)
|
// For ESP32 Dev board (only tested with ILI9341 display)
|
||||||
// The hardware SPI can be mapped to any pins
|
// The hardware SPI can be mapped to any pins
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
//#define TFT_MISO 19 // Matching T_DO
|
//#define TFT_MISO 19 // Matching T_DO
|
||||||
//#define TFT_MOSI 23 // Matching T_DIN
|
//#define TFT_MOSI 23 // Matching T_DIN
|
||||||
//#define TFT_SCLK 18 // Matching T_CLK
|
//#define TFT_SCLK 18 // Matching T_CLK
|
||||||
//#define TFT_CS 17 // Chip select control pin
|
//#define TFT_CS 17 // Chip select control pin
|
||||||
//#define TFT_DC 16 // Data Command control pin
|
//#define TFT_DC 16 // Data Command control pin
|
||||||
//#define TFT_RST 5 // Reset pin (could connect to RST pin)
|
//#define TFT_RST 5 // Reset pin (could connect to RST pin)
|
||||||
|
=======
|
||||||
|
#define TFT_MISO 19 // Matching T_DO
|
||||||
|
#define TFT_MOSI 23 // Matching T_DIN
|
||||||
|
#define TFT_SCLK 18 // Matching T_CLK
|
||||||
|
#define TFT_CS 17 // Chip select control pin
|
||||||
|
#define TFT_DC 16 // Data Command control pin
|
||||||
|
#define TFT_RST 5 // Reset pin (could connect to RST pin)
|
||||||
|
>>>>>>> 0f793cb... Add setLabelDatum
|
||||||
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
|
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
|
||||||
|
|
||||||
//#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
|
#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
|
||||||
|
|
||||||
//#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
|
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
|
||||||
|
|
||||||
//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only
|
//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue