Alright I'll give you a bit of context.
So I have the Widgets class, which has all the widgets I need for my game.
I call the loadMainMenu function of the widget class and then I only call other loadWidgets class with events that start in loadMainMenu, so that's the only thing that I have in my main about the Widgets class.
After the Main menu I press a button and then have other steps before going into a form where I would want the AnimatedSprite there. I also have a combobox where I have a list of name and when I select another item, the Animatedsprite should change according to what was selected..
What my main function looks like (without includes) :
Thanks for your help.
So I have the Widgets class, which has all the widgets I need for my game.
I call the loadMainMenu function of the widget class and then I only call other loadWidgets class with events that start in loadMainMenu, so that's the only thing that I have in my main about the Widgets class.
After the Main menu I press a button and then have other steps before going into a form where I would want the AnimatedSprite there. I also have a combobox where I have a list of name and when I select another item, the Animatedsprite should change according to what was selected..
What my main function looks like (without includes) :
Code Select
RenderWindow window(VideoMode(1080, 720), "CatherineIA");
window.setFramerateLimit(60);
tgui::Gui gui(window);
Widgets widgetHandler;
widgetHandler.loadMainMenu(gui);
sf::Music music;
music.openFromFile("Music_&_Sounds/Music_Wally.ogg");
music.setLoop(true);
music.setVolume(50);
music.play();
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
} else if (event.type == sf::Event::Resized)
{
window.setView(sf::View(sf::FloatRect(0, 0, event.size.width, event.size.height)));
gui.setView(window.getView());
}
gui.handleEvent(event);
}
window.clear();
gui.draw();
window.display();
}
Thanks for your help.