| ▲ | giveexamples 3 hours ago | |
rectcut is a good API for layout if you have a fixed viewport (eg eink display) the API is a very simple one where you slice parts off an initial Rect. the only feature it provides is that it tracks (x, y, h, w) for you. it doesn't work well with intrinsic sizes - it's more of a top down, fixed size thing. | ||
| ▲ | spiffyk 2 hours ago | parent [-] | |
I actually use a very similar paradigm successfully in a game [1] whose (immediate-mode) UI is fully responsive. I allow more operations than just cutting to do that, but the basic idea seems to be the same. The code may look like a bit of a mess at a first glance [2], but I still find it easier to work with and make it do what I actually want with some very basic vector maths, than with the layout-container rules of most UI frameworks. [1]: https://fruitsandtails.fghj.cz/ [2]: https://codeberg.org/spiffyk/FruitsAndTails/src/branch/main/... | ||