locked
How to navigate between xaml page and unity3d game page

    Question

  • i am building a game with unity 3D and visual studio 2013 pro for windows store, i want to add more xaml page but i can't find a way to navigate between unity game page and xaml page. I was thinking like the game will open and the first page will be xaml then the user can select options like instruction , play etc.  and in the background the game will load.

    Please help me to find a way for this. thanks 

    Wednesday, November 19, 2014 5:42 PM

Answers

  • Hello,

    If you are using the free version of Unity you might have some problems. The splash screen is required for initialization so getting the initialization code to work properly and remove the splash screen can be extremely tricky. While theoretically possible it might take a lot of work.

    If you are using the pro version of Unity things get a bit easier because the splash screen can easily be removed and is not required under the license. You still might have a bit of a challenge getting the initialization code running as expected.

    Honestly the easiest way to get things up and running is to just add your additional XAML to the existing MainPage.xaml and use control logic to hide and show the various XAML elements. We did this recently for a game that we wrote for an internal talk. This works really well and decreases the complexity.

    Another possibility is to add a frame to the MainPage.xaml and load your additional xaml pages into this frame. While I haven't tired this it should work but you will still need to deal with showing and hiding the SwapChainPanel.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, November 20, 2014 12:21 AM
    Moderator
  • If you don't want to show Unity's splash screen you need to upgrade to Unity Pro.

    Friday, November 21, 2014 7:07 PM
    Owner

All replies

  • Hello,

    If you are using the free version of Unity you might have some problems. The splash screen is required for initialization so getting the initialization code to work properly and remove the splash screen can be extremely tricky. While theoretically possible it might take a lot of work.

    If you are using the pro version of Unity things get a bit easier because the splash screen can easily be removed and is not required under the license. You still might have a bit of a challenge getting the initialization code running as expected.

    Honestly the easiest way to get things up and running is to just add your additional XAML to the existing MainPage.xaml and use control logic to hide and show the various XAML elements. We did this recently for a game that we wrote for an internal talk. This works really well and decreases the complexity.

    Another possibility is to add a frame to the MainPage.xaml and load your additional xaml pages into this frame. While I haven't tired this it should work but you will still need to deal with showing and hiding the SwapChainPanel.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, November 20, 2014 12:21 AM
    Moderator
  • Thanks james that was really helpful ,

    i was thinking that how can i add xaml elements in the MainPage.xaml in a way that xaml element will initialize  first and the unity splash screen is working in the background so that the ui stay responsive and i doesn't have to show to much of  unity splash screen. actually i am new to unity just a student sorry if i am disturbing any one with my questions.  

    Thursday, November 20, 2014 6:22 AM
  • If you don't want to show Unity's splash screen you need to upgrade to Unity Pro.

    Friday, November 21, 2014 7:07 PM
    Owner