Original Post
By GUI, I mean the in-game interface. I'm curious how people manage the elements that compose a UI (such as lines of text on a window), such that you can find and change them later.
For example, let's say you parse your UI layout from XML, and create a memory model of the elements. Then later, during gameplay, you want to update a line of text to, say, display the HP of a character the player clicked on. How do you find which element to modify?
The only thing that comes to mind is a string map (std::map), and have the game code hardcoded to find a particular element by name. But for me, a red flag goes up whenever I think a map is the solution, so I'm curious if this is how others would do it as well, or if there are better ways to lay them out in memory to be easily found from some sort of identifier.
For example, let's say you parse your UI layout from XML, and create a memory model of the elements. Then later, during gameplay, you want to update a line of text to, say, display the HP of a character the player clicked on. How do you find which element to modify?
The only thing that comes to mind is a string map (std::map