Page 1 of 1

Stop resizing components in FrameWindow

Posted: Thu Jan 22, 2009 10:50
by tpynegar
Hi,

I'm trying to make some dialog's in the editor. I'd like to set it up so that if i change the size of my dialog the size of the components don't change as it can make changes or additions to the dialog take a long time.

The size of the components seems to be proportional to the size of the frame is there anyway to make them absolute.

Thanks,
Tim.

Posted: Thu Jan 22, 2009 13:51
by Van
There are two setting in the CEGUI Layout Editor: Scale (this is relative) and Offset (absolute). HorizontalAlignment and VerticalAlignment affect where they line up from. For example, lets say you have a FrameWindow and contained in the FW you have two Text windows - one on the left, and one on the right. You could set it like this (try this and see what happens):

Scale is usually 0.0 - 1.0

First Window
Left Scale: 0.00
Left Offset 15.0 (moves +15 pixels from left scale end point)
Top Scale: 0.00
Top Offset: 50.00 (moves +50 pixels from top scale end point)
Right Scale: 0.50
Right Offset: -2.0 (moves -2 pixels from right scale end point )
Bottom Scale: 1.0
Bottom Offset: -15.0 ( moves -15 pixels from bottom scale end point )

Second Window
Left Scale: 0.50
Left Offset 2.0
Top Scale: 0.00
Top Offset: 50.00
Right Scale: 1.00
Right Offset: -15.0
Bottom Scale: 1.0
Bottom Offset: -15.0

Now, resize your FW and see what happens. You will notice that the windows stay pretty fixed yet expands and contract from the center. You can play around with it until you get the affect you want. You can also NOT use ANY scale and only use offsets (recommend when doing ScrollablePanes).

The Scale is using relative coordinates based on the size of the parent. The Offset is using absolute coordinates AFTER Scale has been determined - very important to remember!

I hope that helps.

Posted: Sun Jan 25, 2009 21:09
by tpynegar
Thanks a lot got it now, just using offsets for now.