Well not even games, just basic operating systems handle all of that -- for example Windows GDI, or whatever the hell x or other *nix graphics APIs use. Many (PC grade) languages support such features, often as mere shims on top of the OS itself -- for example, Java frames, labels, canvas, etc. being basically adaptations of the respective objects in Windows or etc. These would be, understandably quite difficult to implement in an embedded context, without an OS to handle the multiple layers from hardware interface (drivers) to API.
Most likely, you'll assemble such objects yourself, from bespoke modules that do most of the work, plus a little logic, that's likely internal to your main program, rather than associated to the objects as such. For example, a checkbox typically has its internal logic (concerning a whopping one bit of information), and interfaces automatically (i.e., on creation) with user input and graphics. The same functionality can be built from program logic and a couple images, not needing to be a whole object at all; you likely aren't even using a language (i.e. C, or even ASM) that has the same fleshed-out notion of objects as in OOPL.
For your purposes, "canvas" is probably the keyword you'll find most useful. Compositing is what you're after: you want to draw graphics on top of others, and especially if that needs to be done with alpha (as in antialiasing or etc.), the underlying graphics need to be known as well. This is easiest when a frame buffer is handy (just redraw the damaged sections, and for alpha, just read the previous pixels), but harder when not (perhaps you have to compute the underlying graphics instead).
Libraries are handy, like, as I recall a basic canvas (I recall Adafruit has one) takes just a little too much RAM to be practical on the smaller AVRs, but 8k+ SRAM is enough. And for sure, anything that can host a framebuffer (like a ST32F4, even without external RAM) makes this much easier; if you're using an unbuffered display (i.e., 24-bit RGB+sync or the like) and the onboard panel controller, you also save trouble with an external one.
When you are using an external controller, there's its own limitations to consider. For example, in recent memory, I've worked with two controllers that have the following limitations:
ST7735:
- SPI interface, 10MHz max (or around there, I forget what it is exactly)
- 128 x 160 px typical display size
- 16bpp graphics only
- Single onboard frame buffer
- Arbitrary read or write to a rectangular region of pixels; corners at any pixel location
- Arbitrary direction, up/down/left/right raster within region.
Here you can do single pixel writes, or read modify write (RMW) to take advantage of its frame buffer, but note that there is a huge amount of overhead on changing the location: it's a 128x160 screen so both X and Y are uint16_t. Setting a new region costs
ten bytes, and at 10MHz that's quite slow (so, approx. 100k regions/sec, flat out). Full motion video is not possible, but partial redraw (small animations, etc.) can be done above refresh rate.
Notice if it were a 16-bit parallel interface, this wouldn't be much of a problem (and indeed such are available, like IL9325).
A nice feature about the direction control is, you can write text left-to-right (or anything else) in order, drawing a column of pixels at a time (which can in turn be streamed from a compression routine, at reasonable savings).
S1D13517:
- 8/16-bit parallel interface
- Up to 960x960 display size (800x480 in my case)
- 16 or 24 bpp graphics
- Arbitrary write to rectangular region, x position in steps of 8px, any y position
- Settable transparent color
- Multiple framebuffers
- Limited compositing ("picture in picture", alpha blend mode)
- Left-to-right, top-to-bottom raster fill pattern only
- No framebuffer reads allowed
The transparent color allows compositing well enough, but the limitation of x address makes writing horizontal text a pain. If you don't mind using it as a rigid column format, not so bad I guess; but nice, variable-width fonts are a pain, either requiring a ton of overdraw (transparent padding around the arbitrary-sized character) or
No read from framebuffer, means you need a local buffer, or canvas, to do alpha or AA. (Alpha can be done in limited ways thanks to the hardware, but it's only on rectangular areas (again by the same x mod 8 = 0 limitation) and the transparent color isn't used for the operation, it's simply pixel to pixel.)
The multiple frame buffers, does at least allow seamless double/triple/n-buffering, and also compositing from regions on other buffers, to a target one. I put like 16 freakin MB of SDRAM on my test board (because why not, it's basically zero added cost), which holds almost 13 full frames at 800x480. It's more than enough that you could, for example, hold all eight pixel rotations of a given graphic, and composite them sequentially to the destination for smooth (single pixel) motion.
One thing I haven't seen controllers do much of, is paletted (indexed) graphics. Seems they prefer mostly to store verbatim frame buffers. I'm sure they're out there, shop around; I haven't come across many though. So, although you can do some
lovely work with them, it may be hard to do so today (short of the hard way, translating it all in software).
Tim