Separate the logic of UBODs to a base class and let the actual UBOD implementation only be plain data. This is the first step to add a second type of of UBODs for widgets.
While they requriements are very similar, they still need to be two separate things.
Make textures on widgets not lose their aspect ratio when resizing the viewport
No more oddly sized text on widgets:
Improve the widget hashing function: make it more unique and take a potential text item into consideration
Without that, we could not simply change the text item/label on a widget and force it to re-render automatically.
– only make text textures as wide as necessary
– cache the bounding boxes for different font sizes instead of re-calculating every time
Makes things look less weird and quicker. Also, it becomes painfully apparent how weird it is to type “text textures”.
properly position and and draw text textures on widgets. more WiP.
It is rendered more readable now:
Add most of the new code to the widget and UI pipeline to actually show text labels on top of widgets. This is still very much WiP and to be seen as a proof of concept
The text is rendered in a broken way, we cannot yet show textures and text on the same widget, but it renders:
add more logic on the widget to place a text item (with an optional background). minor renaming of variables on the tile shader. temporarily add a very distinct background colour on the bottom bar main buttons
This brings us even closer to properly render text on widgets: amongst other things it is properly generating the ModelData structure for widgets with text rendering in mind.
add the possiblity to add text labels to the widget class
This is fleshing out the text-on-widgets support started in the
previous commit. Also, this is technically already used for the game mode buttons, but not quite working yet.
add members, getters and setters for text rendering to the widget class
Does exactly what it says! The UI widget base class gets a whole lot of extra boilerplate code, it is not used yet however.