Game dialog/window layout
Posted: 29 Mar 2014, 15:36
I remember a previous discussion on this but can't find the thread.
I currently have this as my main UI Window:
All my my game windows such as inventory, or a dialog window, etc are just UserControls. When I want to show one, I just create the usercontrol via code and add it to the "UI_Windows" children via this:
GetChildren().Add(newWindow);
This works ok...except when some windows are added as children, they distort the other windows. They will resize if I add another window, to match its height at times.
I don't know if this is because UI_Windows is a grid control.
Is there a better way to add/remove dynamic windows to the UI, without affecting others? Should I just remove the parent UI_Windows grid control, and add new Usercontrols inside their own canvases and set their positions, etc?
Thanks,
JC
I currently have this as my main UI Window:
Code: Select all
<Canvas
Name="UI_MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:UserControls="clr-namespace:UserControls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
mc:Ignorable="d">
<Grid Name="UI_Windows">
</Grid>
</Canvas>All my my game windows such as inventory, or a dialog window, etc are just UserControls. When I want to show one, I just create the usercontrol via code and add it to the "UI_Windows" children via this:
GetChildren().Add(newWindow);
This works ok...except when some windows are added as children, they distort the other windows. They will resize if I add another window, to match its height at times.
I don't know if this is because UI_Windows is a grid control.
Is there a better way to add/remove dynamic windows to the UI, without affecting others? Should I just remove the parent UI_Windows grid control, and add new Usercontrols inside their own canvases and set their positions, etc?
Thanks,
JC