Window Size & Position

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

SidRaven
Just popping in
Just popping in
Posts: 5
Joined: Sun Jun 25, 2006 07:54

Window Size & Position

Postby SidRaven » Fri Dec 29, 2006 06:56

Hey guys, i've recently upgraded to 0.5 to gain advantage of some of the new features. One thing which is really bugging me is the Size and Position system. Is there anyway i can still use the old method so that i don't have to do stuff like this:

Code: Select all

Window->setPosition( UVector2 ( cegui_reldim ( 0 ), cegui_reldim ( 0 ) ) );
Window->setSize ( UVector2 ( cegui_reldim ( 0.125f ), cegui_reldim ( 0.125f ) ) );


I really hate this method because i can't achieve the results i want, i've looked around and none of the old methods work anymore. I want to specify the exact coordinates myself, like for position and size by absolute pixels.

Any help you can give me is greatly appreciated. Thanks.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Fri Dec 29, 2006 12:57

cegui_reldim is a macro defined within ceguiUdim.h: #define cegui_reldim(x) CEGUI::UDim((x),0). There's also a macro for absolute dimensions: #define cegui_absdim(x) CEGUI::UDim(0,(x)). You can use that second macro to specify precise size and position values, or use CEGUI::UDim(relative value, absolute value) directly, specifying 0 for the first parameter (relative value), which is what the macro does after all.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 30 guests