Game Development Community

GUI Scaling..

by Jeremiah Fulbright · in Torque Game Engine Advanced · 10/23/2006 (3:33 pm) · 0 replies

I am doing some work with some GUI controls which require specific coordinates on the controls to be passed to various functions to be handled. The one issue I have currently is the rescaling of GUIs based on resolution/parent.

I was looking, but couldn't find what seemed to be a set value for anything that had to do with resize, as a static value would make it easier to compute the real coordinates from the "larger" control or "smaller" control.

The best example being a texture which is 300x20 and I need to do some work within that range of coordinates for that control. At 800x600 or whatever resolution, I sized it at, this will work fine. Changing to a new resolution obviously changes the extent of the control and causes the coordinates to come back higher than 300x20. This throws off my functions, since they don't know what to do there, unless I can grab some values to scale back down programmatically for my calculations.