Author |
Message |
16/08/2021 15:02:59
|
#16
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
I'd be really interested in how you think the designer UI and library could work better for non-Latin character sets and even any feedback around what graphical libraries worked and didn't.
|
|
|
19/08/2021 18:10:28
|
#17
|
k
Joined: Jun 17, 2021
Messages: 18
Offline
|
Thank you,
I looked at the example and documentation. From what I what I understood that I only add code to the void setup of the main .ino
I made a basic project and tried to implement the icons. It compiles, but no Icons on display. I tried once with a text item menu, and once with a submenu.
Should there be a refresh function that I may be missing?
|
|
|
20/08/2021 07:05:38
|
#18
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
The ESP8266 example was missing:
// after changing the drawing properties, always refresh the cache to ensure it draws properly.
tcgfx::ConfigurableItemDisplayPropertiesFactory::refreshCache();
I've added it now but always do that after adjusting the drawing properties.
So the procedure is, add the icon to the icon cache, add the grid position that defines how to draw it, refresh the cache. There is only one thing to be aware of. You can either manually provide every grid position for a submenu, or you need to make sure that the items you are overriding are further down in the order than the automatically arranged ones, otherwise, it will draw the item before it picks up the grid position. The next thing on my list is to do a full start to finish tutorial on graphical rendering.
|
|
|
20/08/2021 13:28:00
|
#19
|
k
Joined: Jun 17, 2021
Messages: 18
Offline
|
Thank you,
I added the new line, but i still dont get an icon on screen. I may be missing something ot maybe I am not understanding the coordinate system and drawing it offscreen
|
|
|
20/08/2021 13:41:04
|
#20
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
It's more like a desktop drawing system, you just say which row you want it to appear on, where 0 is generally reserved for the title, then 1 would be the first item row etc. Same with columns, 0 is the first, 1 is the second, 2 third and so on.
|
|
|
20/08/2021 13:42:38
|
#21
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
As per the other ongoing topic, I'm actually presently working on a tutorial for this. It should be available soon.
|
|
|
16/09/2021 07:38:20
|
#22
|
k
Joined: Jun 17, 2021
Messages: 18
Offline
|
Thank you,
I look forward to the tutorial, as so far I couldn't figure it out.
|
|
|
19/09/2021 10:35:29
|
#23
|
k
Joined: Jun 17, 2021
Messages: 18
Offline
|
I just noticed that there is a version 2.2 Beta release. Could it be that I need that version instead of 2.1?
|
|
|
20/09/2021 09:40:55
|
#24
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
2.2 is now a full release as of this morning.
But it has no changes in the grid drawing code. Did you follow the examples in terms of the grid drawing, there are several examples that show how to render a menu item as an image. But the menu item must be actionable such as a submenu, action or boolean item.
The tutorial is coming out very soon, I needed to get 2.2 out first, as it has some changes that would otherwise invalidate the tutorial.
From 2.2 onwards, the changes will be far more incremental and more focused on plugins and IoT capabilities, as I now consider the core to be complete.
We'll try and look at unicode support. I mean Java (tcmenu designer) uses unicode natively, we need to work out where the issues are in the chain and apply fixes.
|
|
|
22/09/2021 08:08:23
|
#25
|
k
Joined: Jun 17, 2021
Messages: 18
Offline
|
Thank you, I look forward to the updates.
I updated everything, and ran the esp32amplifier from the designer and generated the code matching my rig. And after copying the code for the icons for the links you provided, it worked now, thank you.
Now I am trying to make my own icons, but every convertor i try results in a wrong image. What did you use to make the icons?
|
|
|
22/09/2021 09:05:35
|
#26
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
The icons can either be native bitmaps or XBMP format. I recommend XBMP for what you want to do.
The best tool to use for XBMP that I have found is my favourite image editor - GIMP.
It has an option to export as XBMP that works really well.
I would stick to multiples of 8 to be safe with the widest range of libraries.
|
|
|
27/09/2021 04:25:36
|
#27
|
k
Joined: Jun 17, 2021
Messages: 18
Offline
|
Thank you, really appreciate it! The Icons are perfect now.
Will write what worked for me if anyone else finds this and wants to know how to generate char arrays
Used Gimp and opened my image.
-Resize image to Icons size (e.g. 16*16 pixels)
- Convert image to indexed Black and White (to save memory)
https://docs.gimp.org/2.10/en/gimp-image-convert-indexed.html
- Export as .xbm
- Open generated file with text editor (notepad), and find the char array for the image
|
|
|
02/01/2023 19:17:09
|
#28
|
davetcc
Joined: Jan 19, 2019
Messages: 686
Offline
|
To conclude this thread as it is still searched for a lot, tcMenu now supports TcUnicode. This provides full UTF-8 Unicode with the standard Adafruit_GFX library. It also works for many other display libraries. It is tested with every plugin that we have.
TcMenu Designer can generate menus with this support out of the box. The designer will output C++ files with UTF-8 strings.
https://www.thecoderscorner.com/products/arduino-libraries/tc-unicode-helper/
https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/using-custom-fonts-in-menu/
The support for this is new in 3.0 and will be improved over the next few releases.
|
|
|
|