I’m a little troubled now. I don’t have any ideas on how to change from one screen to another.
Lets say, I have a title screen, and a “main game” screen. I know how to create a new window with the main game, but the title screen window is there too. Is there a way to change from one screen/scene to another but without creating a new window?
I wrote a simple screenmanager for doing transitions earlier, I’ll see if I can put it on github tonight or tomorrow. It doesn’t handle screens on top of screens though (the screenmanager from the samples does IIRC, but it can only handle fading transitions and hardcoded the parameters which I didn’t like).
My plan is to have a screenmanager that has a list of screens, screens have a list of entities and entities have a list of sub entities. in my game class update and draw:
screenmanager.update
screenmanager.draw
and inside screenmanager
foreach (screen in screens)
{
if (screen.updating) screen.update(gameTime)
}
// same again for draw
Then inside each screen class it does a foreach for each entity to update and draw itself etc. trickles down like that.