TFT GUI examples ?

If doesn't fit into any other category ....
Post Reply
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

TFT GUI examples ?

Post by Electroguard »

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 ?
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: TFT GUI examples ?

Post by Electroguard »

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.
User avatar
cicciocb
Site Admin
Posts: 1899
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: TFT GUI examples ?

Post by cicciocb »

Hi Robin,
I'm not at home on these days. I'll send you next week.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: TFT GUI examples ?

Post by Electroguard »

Thank you Sir,
Enjoy your holiday, you've earned it.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: TFT GUI examples ?

Post by Electroguard »

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.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: TFT GUI examples ?

Post by Electroguard »

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)

b.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: TFT GUI examples ?

Post by Electroguard »

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.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: TFT GUI examples ?

Post by Electroguard »

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]]]
Post Reply