#Highlighting options on a OLED.

1 messages · Page 1 of 1 (latest)

daring bramble
#

Basically I am trying to make a program where there are options and you will have up and down arrows to scroll to something to select. I am playing around with having a square box behind the text but the way I am currently processing how to do it seems complicated and I reached out to a friend but he doesn't mess with circuitpython and microprocessors. Anywho he suggested multithreading and this is what he said:

"you could assign one core to run the 'renderer' process which just draws the current frame on an infinite loop and the other core to update the variables like which selection is currently highlighted"
I am pretty confused on how I could implement that or where to even get started.

shadow flame
#

DisplayIO can create layers. Usually used with tilegrid for x,y coordinates.

daring bramble
#

Ahh, I think I found the article?

shadow flame
#

Exactly, it can do almost any GUI you can think of but it takes time to learn the hundreds if not thousands of different things DisplayIO can do.

daring bramble
#

Oh?

shadow flame
#

You'll start at DisplayIO and then end up going down a lot of different rabbit holes. DisplayIO is deep but all you really need to know is that it can do as many layers as your device can handle... and more.

#

The more layers you add and the more you have to draw the slower it will make your microcontroller. There is a price of layers vs performance with layers.

#

Page layouts for example... might be a good start.

daring bramble
#

Well, what I was originally playing with was drawing a box, then drawing letters on top of the box, then when going down to the next option, I would draw a black box big enough over those two options to essentially "clear" those pixels then draw the box where option two is and then re-draw the text for both options.

shadow flame
#

Will this be a touch display project?

daring bramble
#

No, has a display with buttons.

shadow flame
#

the pyportal guide should be close enough except you swap out touch events for button presses.

daring bramble
#

That’s what the Home Screen will look like.

shadow flame
#

Yeah I looked and could not find a simple menu system learn guide or example.

#

and the ones I did find are geared towards touch screens

daring bramble
#

Okay, so probably just go with this “groups” part of this pyportal?

shadow flame
#

yes groups are part of displayio and can be layered.

#

however if you don't have a pyportal then no sense in using it's library because it'll be expecting the pyportal hardware device.

#

i know foamyguy created some menus like that but it was inside an entire game he wrote.

daring bramble
#

So displayio.Group() is not its own part of displayio?

#

It seems here that it doesn't depend off pyportal?

shadow flame
#

you can use group with displayio only yes, don't need the pyportal library with it.

#

Just to demonstrate that what you want to do is definitely possible.

daring bramble
#

I was thinking you were referring to the “group” library when you said “it’s”

#

I’ll watch that video!

shadow flame
#

That's got just about everything to get you started with displayio, tilegrid, groups, bitmaps, sprites, rectangles, etc..

daring bramble
#

Okay. Thank you!

shadow flame
#

Found a library that might be right up your alley

#

It was designed for the macropad which also uses an RP2040 like your pink feather. 😉