Page 1 of 1

Resizing and scaling

Posted: Wed Oct 19, 2005 08:51
by dsmirnov
Greetings.

Is there a way to completely disable auto-scaling of GUI elements (windows and buttons) when I resize application window (maximize it for example)?

Because "AutoScaled" property doesn't help in such case.

Re: Resizing and scaling

Posted: Wed Oct 19, 2005 11:54
by lindquist
if you make sure that your fonts and imagesets have the auto scale atttribute set to false, you should experience no scaling.

If you mean the window sizes etc, you'll have to use only absolute coordinates!

Re: Resizing and scaling

Posted: Thu Oct 20, 2005 13:39
by dsmirnov
Greetings.

As I see "AutoScaled" atttribute for imagesets and fonts only enables/disables scaling with different screen resolutions.

But I have a bit different task: simple OpenGL application window (not fullscreen) and when I resize/maximize this window all it's CEGUI contents automatically scaled as well according to sizes of application window (even mouse pointers). I tried to use only absolute coordinates but it doesn't help. I tried to set size of default CEGUI window to fixed size but it doesn't help as well. It looks like CEGUI absolute/relative coordinates are "relative" to application window sizes.

I need to make window with completely disabled scaling of design elements irrelative to app window resize.

May be I missed something but I still not sure if it's possible to achieve this without change of base code.

Re: Resizing and scaling

Posted: Thu Oct 20, 2005 17:00
by lindquist
are you remembering to update renderer with the new screen size when resizing?

If you dont do this, you'll get some scaling if your viewport _is_ resized to fit!

The mouse cursor or any other imagery does not scale at all with AutoScale disabled!

Re: Resizing and scaling

Posted: Fri Oct 21, 2005 08:32
by dsmirnov
Greetings.

Ok. Let's take simple example from CEGUI samples:
Sample_FirstWindow.

This sample uses TaharezLook.imageset. I have set AutoScaled attribute in it to false.
Also it uses Commonwealth-10.font. I have set AutoScaled attribute to false as well.

Then I changed size and position of single CEGUI window to use absolute coordinates and recompiled example.

What I see after all? Whem I resize application window, everything inside it is resized to fit as well (including mouse cursor).
It behaves like "Change image size" in Photoshop. I need it to behave more like "Change Canvas size".
Where to look? Renderer events?

Re: Resizing and scaling

Posted: Fri Oct 21, 2005 12:46
by lindquist
are you doing this just after you resize ?

Code: Select all

CEGUI::System::getSingleton().getRenderer()->setDisplaySize(CEGUI::Size(nW,nH));

Re: Resizing and scaling

Posted: Fri Oct 21, 2005 14:07
by dsmirnov
Oops. That's what I was missing.

Thank you very much. Now it's ok.