How to disable the auto resizing GUI elements?

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

shinyclaw
Just popping in
Just popping in
Posts: 2
Joined: Wed Oct 06, 2010 11:18

How to disable the auto resizing GUI elements?

Postby shinyclaw » Wed Oct 06, 2010 11:38

Hi all, I wonder how to disable the auto resizing GUI elements when resizing the main app window? I just want them to stay the same size that I defined in the Layout Editor, no matter how big or small is my rendering window.

Thanks for any ideas!

Timo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Sun Feb 14, 2010 09:38

Re: How to disable the auto resizing GUI elements?

Postby Timo » Wed Oct 06, 2010 13:23

The first step is to define all windows in absolute coordinates. In the editor you set the offset value in pixels and set the scale to zero. In program code you use UDim(0, 200) instead of UDim(0.25, 0) etc. The scale coordinate still comes handy in some situations, like if you want to align the window to the right edge you can set the left coordinate to (1, -200) and right coordinate to (1, 0).

The second thing you need is to set AutoScaled="false" in the .font and .imageset files that your project uses. For example:

Code: Select all

<?xml version="1.0" ?>
<Font Name="DejaVuSans-10" Filename="DejaVuSans.ttf" Type="FreeType" Size="10" NativeHorzRes="800" NativeVertRes="600" AutoScaled="false"/>

shinyclaw
Just popping in
Just popping in
Posts: 2
Joined: Wed Oct 06, 2010 11:18

Re: How to disable the auto resizing GUI elements?

Postby shinyclaw » Wed Oct 06, 2010 15:00

Works great, just like you said! Big thanks!


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests