Page 1 of 1

TFT GUI examples ?

Posted: Fri Jul 30, 2021 9:59 pm
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 ?

Re: TFT GUI examples ?

Posted: Sat Jul 31, 2021 9:23 am
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.

Re: TFT GUI examples ?

Posted: Sat Jul 31, 2021 4:57 pm
by cicciocb
Hi Robin,
I'm not at home on these days. I'll send you next week.

Re: TFT GUI examples ?

Posted: Sat Jul 31, 2021 5:09 pm
by Electroguard
Thank you Sir,
Enjoy your holiday, you've earned it.

Re: TFT GUI examples ?

Posted: Sat Aug 07, 2021 10:12 pm
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.

Re: TFT GUI examples ?

Posted: Sun Aug 22, 2021 6:28 pm
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

Re: TFT GUI examples ?

Posted: Sun Aug 22, 2021 11:36 pm
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.

Re: TFT GUI examples ?

Posted: Mon Aug 23, 2021 11:12 pm
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]]]