BT81X - transparent button


#1

Hello,
I’m trying to realize a starter project with Riverdi IoT display and BT81X library.
The project contains a background image (PNG). The image will be split in equal segments, where a touch interaction on a segment should trigger a function with a TAG as function parameter. From basic concept it is a kind of old HTML area map.
At the moment I only figured out how to place buttons on top of the image.
But unfortunately I don’t see any possibility to set the background “invisible” or it’s background color to transparent. Does somebody have an advise for e how this could be realized?

Another question:
The BT81X documentation contains information about more UI components as in the Zeryth wrapper library.
For example PROGRESS, GAUGE, TOGGLE as also commands like GRADIENT, SCALE, ROTATE…
Is there any reason why this are not implemented in the Zerynth python library?

BR
Alex


#2

Hello @alexh225,

I would suggest to not use buttons, but simple text and tags instead.
Let me know if this works for you.

Concerning missing features, the library currently implements the most common functionalities, but, being open source, feel free to add the ones you need (of course I can assist on that, find the source code inside bridgetek/bt81x folder within your zerynth installation folder) and to submit your changes to our repos.


#3

Hey Lorenzo, thanks one more time for fast answer and your advice.
Regarding the idea using the text:
I also tried this as first step - but as far I see in the documentation there is no possibility to set the size (width, height) on the text?
Or is the touch area defined by the function bt81x.track?


#4

Hello @alexh225,

exactly, the touch area is defined by the track function :slight_smile:


#5

Hi @LorenzoR, it seems that the track method doesn’t work in the same way if it is used in combination with text.
Or I’m missing something.
Below few line from my code:

bt81x.track(txt.x, txt.y, BTN_WIDTH, BTN_HEIGHT, TAG_BASE + i)
bt81x.tag(TAG_BASE + i)
bt81x.add_text(txt)

While this is working fine with buttons, in case of text the track has no effect and the touch event is not captured.