I am at the point of designing UI-Logic and I was wondering what a good way to pass asset information to these objects would be.
What I was trying as of yet was passing assets to the objects representing UI-elements through their constructors, leading to code where I pass between 1 to 10 assets (like "button idle" "button being hovered" and "button active" etc.) to the objects or having to create "metaclasses" that define the "look and feel" of these objects that need to be passed to the ui-elements to handle the rendering.
A way I thought of handling this in a "dirty" way was to create a singleton "asset database" that is globally accessible. As every button need's it's own callback function on click it can also get it's own rendering function from where the button can pick it's assets from the accessible assets.
What is a common way to handle this?