- Home /
how to scale GUI box without bearing a constant ratio among width and height?
hi, i'm creating a energy meter. i'm using two GUI box components. The upper box need to scale down in size so that it revel the lower GUI box. so that it felt like a varying energy meter. i need to scale scaling of height without altering width of box gui, how can i acure this?
i'm new to unity.
thanx in advance.
Comment
Answer by Strategos · Sep 11, 2012 at 10:17 AM
float yourWidth = 50.0f; // desired length of bar
GUI.Box(Rect(0,0,yourWidth,10.0f),"This is an energy bar");
Your answer
Follow this Question
Related Questions
Scaling not working 1 Answer
Equirectangular or radial texture scaling on a sphere 0 Answers
Why the scalling between these 2 resolutions is so bad? 1 Answer
Scaling water flow parts 2 Answers
Scaled object immune to clicking 0 Answers