I have a GUI text box that originally used these parameters and looked correct:
GUI.Box (Rect (52, 52, 258, 78), Throttle_Foreground, throttleGuiStyle);
I want the box to scale horizontally based on a variable, but remain the same vertically. I replaced the third parameter with the variable (which resolves to a percentage like .63) like this:
throttleWidth = 258 * (GlobalVariables.gSpeedTarget / GlobalVariables.gThrottleMax);
GUI.Box (Rect (52, 52, throttleWidth, 78), Throttle_Foreground, throttleGuiStyle);
The box scales in both dimensions rather than just horizontally. I’m not sure why. Is there something in the code I should change?
Thanks!