{"id":682,"date":"2013-11-24T18:48:57","date_gmt":"2013-11-24T17:48:57","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=682"},"modified":"2013-11-24T19:09:02","modified_gmt":"2013-11-24T18:09:02","slug":"vb-net-and-xna-article-15-screen-manager-i-e-multi-screens-in-xna","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=682","title":{"rendered":"VB.Net and XNA : Article 15 &#8211; Screen Manager (i.e multi screens in XNA)"},"content":{"rendered":"<p>Another needed feature in games is the ability to display multiple screens : intro, help, main game screen, etc &#8230;<br \/>\nFor sure we could use one unique screen and redraw the whole thing each time but that would quickly become messy with lots of cases.<\/p>\n<p>Here attached a demo that can be used as a basis.<br \/>\nAs always our main module will call the first xna class (clsmain) : standard stuff.<\/p>\n<p>From there we will call the menu screen.<br \/>\nIn that screen, you can either call the help screen the game screen.<br \/>\nIn these 2 screens, you can always go back to the menu screenpushing F10.<\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna_screens.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna_screens-300x123.png\" alt=\"xna_screens\" width=\"300\" height=\"123\" class=\"alignnone size-medium wp-image-683\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna_screens-300x123.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna_screens.png 652w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The code to go from one screen to the other is always :<br \/>\n<code><br \/>\nmy_screen_name= New class_name(Me.game)<br \/>\nScreenManager.ShowScreen(my_screen_name)<br \/>\nMe.Close()<br \/>\n<\/code><\/p>\n<p>The source code : <a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna_demo_01.zip\">xna_demo_01<\/a> .<br \/>\nA project template to help starting new projects : <a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/XNA_SCREENMANAGER.zip\">XNA_SCREENMANAGER<\/a>.<\/p>\n<p>A video to illustrate.<\/p>\n<div style=\"width: 695px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-682-1\" width=\"695\" height=\"434\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna14.mp4?_=1\" \/><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna14.mp4\">https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/xna14.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Another needed feature in games is the ability to display multiple screens : intro, help, main game screen, etc &#8230; 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 <a href='https:\/\/labalec.fr\/erwan\/?p=682' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,35],"tags":[],"class_list":["post-682","post","type-post","status-publish","format-standard","hentry","category-dotnet","category-xna","category-34-id","category-35-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=682"}],"version-history":[{"count":2,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/682\/revisions"}],"predecessor-version":[{"id":688,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/682\/revisions\/688"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}