navigation between panel
hi , I have been trough the northgame demo but I have a hard time understanding how navigation is done .
the game has 10 different screens (all fullscreen) , I want to navigate to a diferent screen when i click a button in the current screen.
can some one point me to a tutorial where it is explained ? thank.
the game has 10 different screens (all fullscreen) , I want to navigate to a diferent screen when i click a button in the current screen.
can some one point me to a tutorial where it is explained ? thank.
Re: navigation between panel
The experts here will likely provide a better explanation. I can share what I do. I have a single top level XAML element <UserControl></UserControl>. I then dynamically swap in user controls as needed to show and hide screens. As a first step, I had my screens declared in the XAML and set to hidden.
When I display screen two, for example, I have code similar to as follows: _Screen2.Visibility = Visibility.Visibile.
Code: Select all
<UserControl>
<local:MyScreen1 x:Name="_Screen1" Visibility="Collapsed"/>
<local:MyScreen2 x:Name="_Screen2" Visibility="Collapsed"/>
<local:MyScreen3 x:Name="_Screen3" Visibility="Collapsed"/>
</UserControl
Re: navigation between panel
Menu3D is also a good and simple example about this.
Note that the Unity version is still using 2.1 and was not tested on 2.2. We are working on it.
Note that the Unity version is still using 2.1 and was not tested on 2.2. We are working on it.
Re: navigation between panel
is this too weight if the screen count is a lot?The experts here will likely provide a better explanation. I can share what I do. I have a single top level XAML element <UserControl></UserControl>. I then dynamically swap in user controls as needed to show and hide screens. As a first step, I had my screens declared in the XAML and set to hidden.
When I display screen two, for example, I have code similar to as follows: _Screen2.Visibility = Visibility.Visibile.Code: Select all<UserControl> <local:MyScreen1 x:Name="_Screen1" Visibility="Collapsed"/> <local:MyScreen2 x:Name="_Screen2" Visibility="Collapsed"/> <local:MyScreen3 x:Name="_Screen3" Visibility="Collapsed"/> </UserControl
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: navigation between panel
Collapsed controls are not processed during layout so they don't affect the performance.
Although the elements in that tree will be initially created, so the memory consumption will be bigger when having all the screens defined in the main window.
Although the elements in that tree will be initially created, so the memory consumption will be bigger when having all the screens defined in the main window.
Re: navigation between panel
i see, thanksCollapsed controls are not processed during layout so they don't affect the performance.
Although the elements in that tree will be initially created, so the memory consumption will be bigger when having all the screens defined in the main window.
Re: navigation between panel
Most games have panels of UI open over the top of each other. For instance, you could hit escape and a menu would pop up over the existing game UI. How can you do that with Noesis?
Re: navigation between panel
you can instantiate them as templates and add them through code behind, or with c# in unity directly.
typically you would get the uiRoot and add it to the children in that case
if you need to reference the objects, you want to declare them first
my approach is 100% programatic and not the usual way for Noesis. but it should give you some insight
you can instantiate xaml files and add them the same way, its all about how those resources are declared
ultimatly, its important to know that whatever is on the bottom of the list of children will be rendered ontop of other items
typically you would get the uiRoot and add it to the children in that case
if you need to reference the objects, you want to declare them first
Code: Select all
noesis = this.GetComponent<NoesisView>();
uiRoot = (Noesis.Grid)noesis.Content;
Noesis.Grid Header = new Noesis.Grid
{
Height = 20;
VerticalAlignment = VerticalAlignment.Top,
HorizontalAlignment = HorizontalAlignment.Stretch,}
uiRoot.Children.Add(Header);
uiRoot.Children.Add(new Noesis.DockPanel
{
Height = 64,
Width = 500,
VerticalAlignment = VerticalAlignment.Bottom,
HorizontalAlignment = HorizontalAlignment.Stretch,
});
you can instantiate xaml files and add them the same way, its all about how those resources are declared
ultimatly, its important to know that whatever is on the bottom of the list of children will be rendered ontop of other items
Re: navigation between panel
But isn't that adding to a grid, and so it would be arranged in a grid like fashion, rather than in an overlay window sort of fashion?
Who is online
Users browsing this forum: Ahrefs [Bot] and 49 guests