doomtoo
Topic Author
Posts: 4
Joined: 11 Oct 2019, 18:17

Workflow + learning path?

04 Jul 2020, 22:07

I'm using Unity, and trying to change out my UI for Noesis.

1. What's the ideal workflow for creating multiple menu's UI for Unity?

2. For someone with no prior experience with XAML/Blend, whats the best learning path?

I've gone through the tutorials, looked at the samples, but really not sure yet how to create multiple menu's, and interact with them dynamically from Unity. So I'm trying to learn more about WPF and Blend (not much out there on Blend, but the basics seem simple enough), to hopefully make it clearer.

I understand the way XAML is structured(similar to HTML/XML), but still unclear on the best workflow for recreating the UI in XAML for multiple menu's, and being able to dynamically interact with it from Unity (loading in dynamic images, dynamically adding in sub components, etc), but hoping it'll be clearer after looking at more tutorials on WPF.
 
User avatar
sfernandez
Site Admin
Posts: 3008
Joined: 22 Dec 2011, 19:20

Re: Workflow + learning path?

08 Jul 2020, 18:29

1. For working with Unity we created a VS project template that setups a Unity project ready to work with Noesis. You create xamls inside Blend project under the Assets folder (organizing the data as you want), and Unity will automatically pick the changes, so when you play the scene it will show the updated xaml.

For designing menus you can create a different UserControl for each screen and then show them in the main page depending on the selected option (we are doing that in our Menu3D sample).

2. The easiest way to work with XAML/Blend is to follow the MVVM pattern. You design the UI in Blend and connect it to the properties of a ViewModel using bindings. Actions in the UI can be notified to the ViewModel via property value changes, or using commands. For example, if you are designing a Settings page, you can have a ViewModel that exposes properties for each setting, and a couple of commands for Applying or Cancelling the changes made to the settings. In the xaml you will bind to those properties, and a pair of Buttons will bind their Command property to the corresponding view model command.

Our samples in GitHub follow that approach, as you can see in the Tic Tac Toe game.

Dynamic UI is usually generated when you associate DataTemplates with your view model data. For example, if you have in your game a list of players, you can expose that in your ViewModel as an ObservableCollection<Player>. Then you can have an <ItemsControl ItemsSource="{Binding Players}" ItemTemplate="{StaticResource PlayerTemplate}">. The PlayerTemplate will define the UI that represents each Player, and if you add new players to the Players list, the UI automatically detects that and creates new items applying the player template.

Hope this helps, if you need help on a specific topic feel free to ask again.

Who is online

Users browsing this forum: No registered users and 9 guests