Hi,
When drawing the GUI with draw() it draws all widgets stored within the GUI. At the moment my code looks like this:
Where I have implemented a state machine so that each state has control over the sf::Texts and sf::Sprites being rendered. The issue that I am having is that I am rendering text that needs to go on top of a widget, but since I am rendering the GUI after the text, the widget is being drawn on top of the text preventing you from seeing it. I did get around this in an earlier project by simply creating a second GUI so that I could store the overlapping widgets within the second GUI and render that prior to rendering the text. However I have read in past forum posts that you probably shouldn't be creating multiple instances of tgui::Gui.
So, I am wondering what is the best way to go about controlling when specific widgets are rendered (like how I am controlling the text / sprites being rendered with the state machine) rather than having them all render at the same time. Thanks.
When drawing the GUI with draw() it draws all widgets stored within the GUI. At the moment my code looks like this:
Code Select
current_state->render();
gui->render();Where I have implemented a state machine so that each state has control over the sf::Texts and sf::Sprites being rendered. The issue that I am having is that I am rendering text that needs to go on top of a widget, but since I am rendering the GUI after the text, the widget is being drawn on top of the text preventing you from seeing it. I did get around this in an earlier project by simply creating a second GUI so that I could store the overlapping widgets within the second GUI and render that prior to rendering the text. However I have read in past forum posts that you probably shouldn't be creating multiple instances of tgui::Gui.
So, I am wondering what is the best way to go about controlling when specific widgets are rendered (like how I am controlling the text / sprites being rendered with the state machine) rather than having them all render at the same time. Thanks.