Custom panel implementation
We are currently evaluating NoesisGUI for our game (based on the Unity game engine). So far it looks really promising.
One of the features in our game is a quite extensive mod support from simple mods with just new content to complex mods with new code and UI changes (new controls or modifying existing ones). In a proof of concept we were able verify that this is possible with NoesisGUI. But there is one important step for which we don't have a solution yet.
The POC uses an ItemsControl with data binding and data templates to render all controls into a StackPanel. But for our game we need a more capable layout component, to align controls at each other. So for example if a mod wants to add a new control above the minimap, it can specify this via layout constraints (something like... the lower right corner of the new control is at the upper right corner of the minimap control).
In WPF we would create a custom panel implementation which provides a few attached properties to specify the layout constraints. But as far as we see, this is not possible in NoesisGUI, because the panel class doesn't provide the necessary methods (like MeasureOverride and ArrangeOverride). We found a similar post in the forum (viewtopic.php?f=3&t=428) which is almost 4 years old, but doesn't have a solution.
Is this somehow possible with newer versions of NoesisGUI? Maybe by providing the panel implementation as native code like the other framework classes in NoesisGUI? Or do you have another suggestion how this can be achieved?
One of the features in our game is a quite extensive mod support from simple mods with just new content to complex mods with new code and UI changes (new controls or modifying existing ones). In a proof of concept we were able verify that this is possible with NoesisGUI. But there is one important step for which we don't have a solution yet.
The POC uses an ItemsControl with data binding and data templates to render all controls into a StackPanel. But for our game we need a more capable layout component, to align controls at each other. So for example if a mod wants to add a new control above the minimap, it can specify this via layout constraints (something like... the lower right corner of the new control is at the upper right corner of the minimap control).
In WPF we would create a custom panel implementation which provides a few attached properties to specify the layout constraints. But as far as we see, this is not possible in NoesisGUI, because the panel class doesn't provide the necessary methods (like MeasureOverride and ArrangeOverride). We found a similar post in the forum (viewtopic.php?f=3&t=428) which is almost 4 years old, but doesn't have a solution.
Is this somehow possible with newer versions of NoesisGUI? Maybe by providing the panel implementation as native code like the other framework classes in NoesisGUI? Or do you have another suggestion how this can be achieved?
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Custom panel implementation
Sorry for the late answer, we were very busy with all GDC stuff, but we are back to normal during this week.
C# panel doesn't allow yet to reimplement MeasureOverride and ArrangeOverride.
We will expose it in the following minor release.
In your scenario is not possible to use DockPanel to layout elements the way you want?
C# panel doesn't allow yet to reimplement MeasureOverride and ArrangeOverride.
We will expose it in the following minor release.
In your scenario is not possible to use DockPanel to layout elements the way you want?
Re: Custom panel implementation
Thanks for the reply.
The standard panels wont work for this, because we don't have pre-defined slots where mods can insert new controls. The idea is, that mods can place their controls relative to any other control. So it's more like a canvas, but with layout support.
Do you know when the minor release will be available? Days, weeks or months? Depending on this information we will just wait with this feature or look for a workaround.
The standard panels wont work for this, because we don't have pre-defined slots where mods can insert new controls. The idea is, that mods can place their controls relative to any other control. So it's more like a canvas, but with layout support.
Do you know when the minor release will be available? Days, weeks or months? Depending on this information we will just wait with this feature or look for a workaround.
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Custom panel implementation
We expect the next release will be in a few weeks including some crash fixes and some pending bugs.
Re: Custom panel implementation
Just to make sure we are going to implement what you need, you just need to override MeasureOverride and ArrangeOverride right?
Re: Custom panel implementation
sorry for the delay, i didn't received a notification.
Yes those two methods would be enough for now.
Yes those two methods would be enough for now.
Re: Custom panel implementation
I did a quick check to verify my last answer and it seems there is another thing missing to create custom panels with Noesis.
The property Panel.InternalChildren is also not available. Everything else (Measuring an element, getting the desired size and arranging it) is possible.
So it's FrameworkElement.MeasureOverride, FrameworkElement.ArrangeOverride and Panel.InternalChildren
The property Panel.InternalChildren is also not available. Everything else (Measuring an element, getting the desired size and arranging it) is possible.
So it's FrameworkElement.MeasureOverride, FrameworkElement.ArrangeOverride and Panel.InternalChildren
Re: Custom panel implementation
Could you please create a ticket about it?
Re: Custom panel implementation
Hi,
will this be part of the NoesisGUI 2.2 Beta?
will this be part of the NoesisGUI 2.2 Beta?
Who is online
Users browsing this forum: Semrush [Bot] and 94 guests