natinusala / borealis

Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx)
Apache License 2.0
257 stars 81 forks source link

Drawable and drawing classes #102

Open natinusala opened 3 years ago

natinusala commented 3 years ago

The concept of "drawing" can be defined in its own class. It would allow generalizing things like shapes, with common properties such as border color / radius, corner radius, shadow, etc...

A drawing is made of one or multiple layers.

A layer is made of multiple properties:

Basically the same thing as what make the view backgrounds now.

Note: the current view background has a stub for a "custom" shadow that's not actually implemented. It should be implemented in drawings. The idea is to ask the user for all shadow properties (width, feather, opacity, offset).

View backgrounds can then be entirely replaced with a single Drawing, which will then take care of all the rendering.