Nov 242013
 

Another needed feature in games is the ability to display multiple screens : intro, help, main game screen, etc …
For sure we could use one unique screen and redraw the whole thing each time but that would quickly become messy with lots of cases.

Here attached a demo that can be used as a basis.
As always our main module will call the first xna class (clsmain) : standard stuff.

From there we will call the menu screen.
In that screen, you can either call the help screen the game screen.
In these 2 screens, you can always go back to the menu screenpushing F10.

xna_screens

The code to go from one screen to the other is always :

my_screen_name= New class_name(Me.game)
ScreenManager.ShowScreen(my_screen_name)
Me.Close()

The source code : xna_demo_01 .
A project template to help starting new projects : XNA_SCREENMANAGER.

A video to illustrate.

 Posted by at 18 h 48 min

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.