TFT GUI examples ?
- Electroguard
- Posts: 1094
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 373 times
- Been thanked: 392 times
TFT GUI examples ?
I could have sworn I've ran some TFT GUI examples in the past, but I can't find anything now... so I'm worried it might be the start of senile dimentia ?
- Electroguard
- Posts: 1094
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 373 times
- Been thanked: 392 times
Re: TFT GUI examples ?
CiccioCB, have you still got the GUI examples you used for the screen dumps in the GUI Help section ... you must have given me them when you first created the GUI objects, cos I seem to remember a multi-page example which brought up Page1, Page2 etc using image buttons.
It was around the same time that some of the TFT scripts got broken by various changes, cos I've actually found a couple of early TFT Menu scripts using GUI objects which I was developing on a device that got abandoned, but none of my computer archives have survived.
It was around the same time that some of the TFT scripts got broken by various changes, cos I've actually found a couple of early TFT Menu scripts using GUI objects which I was developing on a device that got abandoned, but none of my computer archives have survived.
- cicciocb
- Site Admin
- Posts: 2792
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 592 times
- Been thanked: 1993 times
- Contact:
- Electroguard
- Posts: 1094
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 373 times
- Been thanked: 392 times
- Electroguard
- Posts: 1094
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 373 times
- Been thanked: 392 times
Re: TFT GUI examples ?
Hi CiccioCB,
I did find many GUI examples on an old SD, but none in the firmware data zips, so I was going to create a TFT GUI Examples topic under Programming Examples and put them there, which could offer a good place for others to publish their examples such as Fernando's splash screen and TrevorB's Robot Camera when done.
But many of the original GUI examples had problems for one reason or another, and I even had problems getting some of the TFT font instructions to work as per the Help, so I thought it best just to wait for you to publish freshened TFT GUI examples as and when opportunity permits.
I did find many GUI examples on an old SD, but none in the firmware data zips, so I was going to create a TFT GUI Examples topic under Programming Examples and put them there, which could offer a good place for others to publish their examples such as Fernando's splash screen and TrevorB's Robot Camera when done.
But many of the original GUI examples had problems for one reason or another, and I even had problems getting some of the TFT font instructions to work as per the Help, so I thought it best just to wait for you to publish freshened TFT GUI examples as and when opportunity permits.
- Electroguard
- Posts: 1094
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 373 times
- Been thanked: 392 times
Re: TFT GUI examples ?
I've worked through all the GUI examples and updated about a dozen with revised syntax... no point me hosting the zip upload though, and not sure what other examples are to be published as well, so will wait till you're back, then send a zip of those I've done, plus a list of those I've deliberately left.
Seeing my ancient M5stack Menu (which stopped working after a firmware update) prompted me to try developing a new 'Flexy Menu' that could take advantage of the new GUI touch objects (which BTW are quite amazing !).
But whereas it was possible to print TFT text with a transparent background, I cannot find a way to display a Gui.Textline with a transparent background and transparent textbox frame.
So some feedback...
It would be an advantage if all gui objects could recognise -1 for transparent fill (some do, but not all).
Likewise it would be useful if the component frames (borders) could be made transparent (or turned off, eg: set thickness=0).
It would also be useful if TFT.IMAGE filename$, [x, y [, back_color] ] could accept negative offset values again (it did when first introduced).
(this could allow intelligent repositioning of different size images in different orientations etc)
Seeing my ancient M5stack Menu (which stopped working after a firmware update) prompted me to try developing a new 'Flexy Menu' that could take advantage of the new GUI touch objects (which BTW are quite amazing !).
But whereas it was possible to print TFT text with a transparent background, I cannot find a way to display a Gui.Textline with a transparent background and transparent textbox frame.
So some feedback...
It would be an advantage if all gui objects could recognise -1 for transparent fill (some do, but not all).
Likewise it would be useful if the component frames (borders) could be made transparent (or turned off, eg: set thickness=0).
It would also be useful if TFT.IMAGE filename$, [x, y [, back_color] ] could accept negative offset values again (it did when first introduced).
(this could allow intelligent repositioning of different size images in different orientations etc)
You do not have the required permissions to view the files attached to this post.
- Electroguard
- Posts: 1094
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 373 times
- Been thanked: 392 times
Re: TFT GUI examples ?
Another evolutionary change which I noticed with my M5 Menu scripts and your M5 scripts such as simple MP3 player is that earlier versions of Annex32 used to acknowledge pin interrupts without needing to first declare the pins as inputs, eg:
interrupt 39, UP
interrupt 38, OK
interrupt 37, DOWN
But Annex32 WiFi BLE CAN 1.43.5 doesn't recognise those interrupts unless the pins have already been defined as inputs, eg:
lpin=39: pin.mode lpin,input,pullup: interrupt lpin,lpress
mpin=38: pin.mode mpin,input,pullup: interrupt mpin,mpress
rpin=37: pin.mode rpin,input,pullup: interrupt rpin,rpress
There is no obvious clue as to which of your many examples may use M5 buttons that may need updating, and it would not be practical updating odds and ends of downloaded files which would then need to be sent back again, but now that you are aware perhaps it could be a straightforward automated find and replace through all your examples scripts.
interrupt 39, UP
interrupt 38, OK
interrupt 37, DOWN
But Annex32 WiFi BLE CAN 1.43.5 doesn't recognise those interrupts unless the pins have already been defined as inputs, eg:
lpin=39: pin.mode lpin,input,pullup: interrupt lpin,lpress
mpin=38: pin.mode mpin,input,pullup: interrupt mpin,mpress
rpin=37: pin.mode rpin,input,pullup: interrupt rpin,rpress
There is no obvious clue as to which of your many examples may use M5 buttons that may need updating, and it would not be practical updating odds and ends of downloaded files which would then need to be sent back again, but now that you are aware perhaps it could be a straightforward automated find and replace through all your examples scripts.
- Electroguard
- Posts: 1094
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 373 times
- Been thanked: 392 times
Re: TFT GUI examples ?
The gui.button color_pressed and color_released both need to be swapped around, likewise in the gui.setcolor syntax.
They both work ok, but the first color is the default un-pressed (released) which is followed by the 'pressed' color, so is just a doc (Help) syntax change.
gui.Button
But1 = GUI.Button(x, y, width, height, "text" [,font] [,radius] [,toggle] [,group] [,color_text] [,color_pressed] [,color_released] [,color_frame] )
Button
Gui.SetColor object, color_text [,color_pressed [,color_released [,color_frame]]]
They both work ok, but the first color is the default un-pressed (released) which is followed by the 'pressed' color, so is just a doc (Help) syntax change.
gui.Button
But1 = GUI.Button(x, y, width, height, "text" [,font] [,radius] [,toggle] [,group] [,color_text] [,color_pressed] [,color_released] [,color_frame] )
Button
Gui.SetColor object, color_text [,color_pressed [,color_released [,color_frame]]]
-
- Posts: 523
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 293 times
- Been thanked: 165 times
Re: TFT GUI examples ?
Maybe Electroguard can shed some light on those specific examples, but in the meantime, there are a few TFT GUI examples to be found in the "programming examples" section.
Were you after any particular type of example?
Were you after any particular type of example?