is there a way to specify an absolute window size (e.g. in screenpixels) so that the window isn't scaled if the resolution is changed?
and is it also possible to setup absolute positions for the widgets within the windows?
absolute window size
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Yes to both questions.
Virtually all parts of the system use the 'UDim' concept which provides scale and offset components, to specify an absolute size or position you use the offset part of the UDim and set the scale to 0.
Virtually all parts of the system use the 'UDim' concept which provides scale and offset components, to specify an absolute size or position you use the offset part of the UDim and set the scale to 0.
Code: Select all
// Position a window to pixel coordinates (10,20)
myWnd->setPosition( CEGUI::UVector2( CEGUI::UDim( 0, 10 ), CEGUI::UDim( 0, 20 ) ) );
// Set window size to 150 x 200 pixels
myWnd->setSize( CEGUI::UVector2( CEGUI::UDim( 0, 150 ), CEGUI::UDim( 0, 200) ) );
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
The fonts have an 'autoscaled' setting, if you turn this off the text will no longer rescale along with the vp.
You can do this within the font XML by changing the attribute part:
to
or in code by:
You can do this within the font XML by changing the attribute part:
Code: Select all
Autoscaled="true"
to
Code: Select all
Autoscaled="false"
or in code by:
Code: Select all
// myFont is a ptr to the font object
myFont->setProperty( "AutoScaled", "false" );
Who is online
Users browsing this forum: No registered users and 23 guests