Page 1 of 1

Window Size & Position

Posted: Fri Dec 29, 2006 06:56
by SidRaven
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.

Posted: Fri Dec 29, 2006 12:57
by Rackle
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.