Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TFT_eSPI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
TFT_eSPI
Commits
87aca912
Commit
87aca912
authored
Feb 06, 2020
by
Bodmer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Bodmer/TFT_eSPI
parents
15c13763
135604b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
Extensions/Button.cpp
Extensions/Button.cpp
+2
-2
examples/Generic/TFT_Button_Label_Datum/TFT_Button_Label_Datum.ino
...Generic/TFT_Button_Label_Datum/TFT_Button_Label_Datum.ino
+1
-1
keywords.txt
keywords.txt
+1
-0
No files found.
Extensions/Button.cpp
View file @
87aca912
...
...
@@ -69,9 +69,9 @@ void TFT_eSPI_Button::drawButton(bool inverted, String long_name) {
uint8_t
tempdatum
=
_gfx
->
getTextDatum
();
_gfx
->
setTextDatum
(
_textdatum
);
if
(
long_name
==
""
)
_gfx
->
drawString
(
_label
,
_x1
+
_xd
,
_y1
+
(
_h
/
2
)
+
_yd
);
_gfx
->
drawString
(
_label
,
_x1
+
(
_w
/
2
)
+
_xd
,
_y1
+
(
_h
/
2
)
-
4
+
_yd
);
else
_gfx
->
drawString
(
long_name
,
_x1
+
_xd
,
_y1
+
(
_h
/
2
)
+
_yd
);
_gfx
->
drawString
(
long_name
,
_x1
+
(
_w
/
2
)
+
_xd
,
_y1
+
(
_h
/
2
)
-
4
+
_yd
);
_gfx
->
setTextDatum
(
tempdatum
);
}
...
...
examples/Generic/TFT_Button_Label_Datum/TFT_Button_Label_Datum.ino
View file @
87aca912
...
...
@@ -118,7 +118,7 @@ void drawButtons()
// Adjust button label X delta according to array position
// setLabelDatum(uint16_t x_delta, uint16_t y_delta, uint8_t datum)
key
[
i
].
setLabelDatum
(
i
*
10
,
0
,
ML_DATUM
);
key
[
i
].
setLabelDatum
(
i
*
10
-
(
KEY_W
/
2
)
,
0
,
ML_DATUM
);
// Draw button and specify label string
// Specifying label string here will allow more than the default 10 byte label
...
...
keywords.txt
View file @
87aca912
...
...
@@ -99,6 +99,7 @@ TFT_eSPI_Button KEYWORD1
initButton KEYWORD2
textcolor KEYWORD2
initButtonUL KEYWORD2
setLabelDatum KEYWORD2
drawButton KEYWORD2
contains KEYWORD2
press KEYWORD2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment