Driklyn
Member
|
Disable D.scale
Is it possible to disable the automatic scaling of Gui? I want the height of my Gui elements to stay the same when running in windowed mode or maximized windowed mode (i.e. a height of 20px when in windowed mode and a height of 20px when in maximized windowed mode).
Right now, I am dynamically calculating D.scale, with its value starting at 1 becoming smaller the larger the height of the window gets. This is working pretty good, but, perhaps due to floating-point precision, it's value is slightly off causing the Gui to appear slightly misaligned.
(This post was last modified: 05-19-2011 09:20 PM by Driklyn.)
|
|
05-19-2011 04:53 AM |
|
Esenthel
Administrator
|
RE: Disable Gui.scale
There is No gui.scale
You need to adjust D.scale in D.screen_changed
Something like D.scale(800./D.y()) or reversed division
|
|
05-19-2011 10:06 AM |
|
Driklyn
Member
|
RE: Disable Gui.scale
Hah, I meant D.scale, not Gui.scale...
Thanks, that works perfectly! I thought I had already tried that, but I must have somehow did it wrong cause it wasn't working right at the time. I was doing something similar to that, but it was a bit more complicated and was giving a slightly inaccurate value.
This works (must cast to float):
Code:
D.scale(600 / (Flt)D.y());
|
|
05-19-2011 09:19 PM |
|