Sub-menus on separate xaml files?
Posted: 24 Mar 2019, 12:23
Lets say I have a menu in a game, eg. your typical main menu where you have Start New Game, Load Game, Optons and Exit. If you click the options button the main menu is hidden and an options window is shown instead. If you click Back on the options menu you go back to the main menu.
How would you structure this? Do you have both the main menu buttons and the options menu window in the same xaml file and toggle visibility on/off at runtime, or do you put the main menu in one xaml file and the options menu in another? If you go the route of two xaml files, you also have to have two views loaded (assuming a native C++ engine here) and you have to make sure you switch between the views, routing input and rendering the active one etc, right? Also, does having two separate xamls (and by extension, I guess, two separate views) affect the possibility of animating the transition between the main menu and the options menu? Ie. do they have to be in the same xaml to be able to animate the transition easily?
Lastly, can I have the two menus in separate files, eg. to be able to edit them in Blend individually, but still have them both loaded into the same view at runtime?
Thanks!
How would you structure this? Do you have both the main menu buttons and the options menu window in the same xaml file and toggle visibility on/off at runtime, or do you put the main menu in one xaml file and the options menu in another? If you go the route of two xaml files, you also have to have two views loaded (assuming a native C++ engine here) and you have to make sure you switch between the views, routing input and rendering the active one etc, right? Also, does having two separate xamls (and by extension, I guess, two separate views) affect the possibility of animating the transition between the main menu and the options menu? Ie. do they have to be in the same xaml to be able to animate the transition easily?
Lastly, can I have the two menus in separate files, eg. to be able to edit them in Blend individually, but still have them both loaded into the same view at runtime?
Thanks!