Stop resizing components in FrameWindow

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

tpynegar
Just popping in
Just popping in
Posts: 6
Joined: Thu Jan 22, 2009 10:46

Stop resizing components in FrameWindow

Postby tpynegar » Thu Jan 22, 2009 10:50

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.

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Postby Van » Thu Jan 22, 2009 13:51

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.

tpynegar
Just popping in
Just popping in
Posts: 6
Joined: Thu Jan 22, 2009 10:46

Postby tpynegar » Sun Jan 25, 2009 21:09

Thanks a lot got it now, just using offsets for now.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests