project setup question
Up to now, we've only been using Noesis for our in-game HUD/UI. We'd like to add it to the front end (ie, completely out of game simulation). Are there any guidelines for this or suggestions on how to organize our project? Is it best to keep it as a completely separate blend project, or do you suggest 1 blend project for both in-game and front end? Currently, our "StartupUri" is our in-game HUD - would we change it to something more generic like "MainWindow" that would include both the in-game hud and the front end? Is there a noesis example that demonstrates this (I looked but didn't really see any of them jumping out at me as "this is the way to do this!" -- they seem much more isolated on a specific problem).
thanks,
sam
thanks,
sam
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: project setup question
Hi Sam,
We recommend using a single Blend project with all your game UI, and organize the files in as many folders as you need. Then you can change which xaml you want to show in Blend by modifying the StartupUri in the App.xaml.
Some customers created a more complex "MainWindow" in Blend that allowed them to switch the xaml to show in runtime, but I think selecting the xaml in the StartupUri combo box is easy enough.
What kind of example would you like to see related to this, we can think of adding one if it is useful for others.
Cheers.
We recommend using a single Blend project with all your game UI, and organize the files in as many folders as you need. Then you can change which xaml you want to show in Blend by modifying the StartupUri in the App.xaml.
Some customers created a more complex "MainWindow" in Blend that allowed them to switch the xaml to show in runtime, but I think selecting the xaml in the StartupUri combo box is easy enough.
What kind of example would you like to see related to this, we can think of adding one if it is useful for others.
Cheers.
Re: project setup question
Hi Sam, I sent you an email to further discuss this.
Re: project setup question
What I've landed on right now is this:
- I kept one blend project for everything
- I have two separate data models - one for when you are playing the game, another for the front end
- We're using Unity, and our "bootstrap" scene is purposefully kept extremely lean; it basically depends on nothing else. It has a camera in this scene, and I added a Noesis View component to the camera, but kept the XAML field set to "None"
- I created a new "Front End" scene that has a link to the root xaml file we use for our front end
- After we asynchronously load the front end scene, I grab the camera from the bootstrap scene, set the 'Xaml' field on the view, and then call "LoadXaml"
- Our game camera is kept in a separate gameplay scene - it also has a Noesis view on it, with the XAML reference set to the root xaml file for the in-game UI
- When we move from our front end to the game, we toggle the current rendering camera from the bootstrap camera to the gameplay camera
Does this seem reasonable?
I guess I don't really understand where the App.xaml file actually gets used. The startupuri there references our gameplay xaml at the moment, but I don't see where we link to the app xaml directly in our app -- it seems like we just add the noesis view component to our camera and then point it directly at the xaml we want it to render. Is that a bad pattern?
thanks,
sam
- I kept one blend project for everything
- I have two separate data models - one for when you are playing the game, another for the front end
- We're using Unity, and our "bootstrap" scene is purposefully kept extremely lean; it basically depends on nothing else. It has a camera in this scene, and I added a Noesis View component to the camera, but kept the XAML field set to "None"
- I created a new "Front End" scene that has a link to the root xaml file we use for our front end
- After we asynchronously load the front end scene, I grab the camera from the bootstrap scene, set the 'Xaml' field on the view, and then call "LoadXaml"
- Our game camera is kept in a separate gameplay scene - it also has a Noesis view on it, with the XAML reference set to the root xaml file for the in-game UI
- When we move from our front end to the game, we toggle the current rendering camera from the bootstrap camera to the gameplay camera
Does this seem reasonable?
I guess I don't really understand where the App.xaml file actually gets used. The startupuri there references our gameplay xaml at the moment, but I don't see where we link to the app xaml directly in our app -- it seems like we just add the noesis view component to our camera and then point it directly at the xaml we want it to render. Is that a bad pattern?
thanks,
sam
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: project setup question
Hi Sam, that setup seems fine to me. Just one question, as you have two NoesisView components, how do you handle the input? Are you enabling/disabling the keyboard/mouse on the corresponding view component?
Regarding the App.xaml, it is not used in Unity. That xaml is only necessary for Blend, so you can run the Blend application.
Regarding the App.xaml, it is not used in Unity. That xaml is only necessary for Blend, so you can run the Blend application.
Who is online
Users browsing this forum: Bing [Bot] and 57 guests