My problem could probably be solved with a simple addition of code, but I’m trying to learn gui. What I’m trying to do is make a power bar grow from the bottom, however, OnGUI by default is anchored to the top left so my begin group shrinks from the bottom and I need it to grow up, not down. I’ve searched everywhere and only found answers to a text based gui label and I need a 2d texture based which seems to be a completely different story because of the convenient alignment with text in a guistyle or skin.
#pragma strict
var pBarImage : Texture2D;
var pBarOutline : Texture2D;
var power : float = 10;
function OnGUI () {
GUI.BeginGroup(Rect(Screen.width * 0, Screen.height * -0.004, Screen.width * 0.208 , Screen.height - power) );
GUI.Label(Rect(Screen.width * 0, Screen.height * -0.004, Screen.width * 0.208, Screen.height * 0.24), pBarImage );
GUI.EndGroup();
GUI.Label(Rect(Screen.width * 0, Screen.height * -0.004, Screen.width * 0.208, Screen.height * 0.24), pBarOutline);
}
Thanks for future help