Vertical/Horizontal Widget Alignment/Sizing

Use this forum for:
- Discussion regarding unofficial CEGUI related tools, scripts and utilities.
- User to user help for the obsoleted CELayoutEditor and CEImagesetEditor tools.

Moderators: CEGUI MVP, CEGUI Team

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Vertical/Horizontal Widget Alignment/Sizing

Postby daves » Fri Apr 04, 2008 11:29

Hi
I'd like to ask you guys what you do to "align/size" widgets that you layout with the layout editor. I find that it is very hard to get alignments and sizes where I want them. Currently what I have been doing is getting the placement and size close with the editor, and then hand editing the XML at the end.

Are there any plans to add "lock to grid" and "auto align/size" functions to the editor?

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Fri Apr 04, 2008 14:25

Hi,

i'm affraight this functionalitiy is a bit of mixed bag ATM, and works as follows:

-Alignment (view->align) works by aligning windows by their 'full' UDim position, meaning any combination of relative and/or pixel values are respected.

-Snap: it is already possible to snap windows to grid. (maybe we should enable the grid by default to make this more clear). Via the view menu you can setup a grid. Press 'g' to snap a window. I just notice by looking at the code that this is always done on relative values. This should also respect pixel values like the alignment functionality.

Lock to grid might be a next iteration in this positioning functionality.

HTH.
Check out my released snake game using Cegui!

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Postby daves » Fri Apr 04, 2008 16:22

Wow.. Ok sounds like I need to dig a bit more. This is great. I'll give both these a shot.

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Postby daves » Fri Apr 04, 2008 18:03

Just a couple quick comments.

The Align functions (top, bottom, left, right) and (width, height) work nicely. This helps a lot.

The "snap to grid" function has a couple of quirks which make it so its necessary to realign a lot.

1] If I just click on an element in order to modify its attributes, but not in order to move or size it, it will often move anyways. This will then require a realignment action.

2] If I hit "g" several times on a single widget that has already been aligned. It will continue to "nudge" it rather than keeping the initial grid alignment that was established.

To me the best thing to do would be to apply the grid restriction whenever a widget is moved or sized. In other words, do it in real-time rather than requiring a "g" after the fact. Another nice feature would be to respond to the "left, right, up, down" arrows in a way such that with each click a widget moves left, right, up, down by one "grid cell". Currently it seems as if the widget moves by some other hard-coded amount.

Anyways I'll continue to play and figure out the best way to leverage those existing features.. As they stand they will really help alot.

Thanks for pointing them out.


Return to “Unofficial CEGUI-Related Tools”

Who is online

Users browsing this forum: No registered users and 6 guests