HeroEngine Forums

HeroEngine Support => GUI Creation => Topic started by: Legacy on May 03, 12, 01:00:26 PM

Title: [Resolved] Dock GUI control with margin?
Post by: Legacy on May 03, 12, 01:00:26 PM
Hello I have a GUI related question this time:

Is it possible, when you specify Dock mode for your control to have a margin from screen edge? I know I can make it a child of a transparent panel that would work I am just looking for some more elegant solution :)

Thanks

EDIT: also, how would one dock item to center of the screen/edge?
Title: Re: Dock GUI control with margin?
Post by: HE-Cooper on May 03, 12, 01:25:21 PM
We use spacer panels to do the docking with margin. Truthfully, it's all a little over complicated for much of the default usage, but as with all things in the engine, it pays off when you are trying to do complicated things.

I would check out FPS Ref's UI as it pretty much has an example of every easy default docking and placement of UI elements. Between the system menus, and the game UI.
Title: Re: Dock GUI control with margin?
Post by: FI-ScottZ on May 03, 12, 06:42:53 PM
You could also use a 9-slice (http://wiki.heroengine.com/wiki/GUI9Slice#Margin) as the parent where the 8 outer sections can serve as a margin.

EDIT: A note about this technique which I discovered recently when doing this.  After setting the margin and then setting a child to dock FILL, it seemed to fill everything and not respect the margin. But it simply was not updating the display properly; saving, closing, and re-opening showed that the margin did properly rein in the fill control.