Is it possible to flip a GUI.BeginGroup box?

I have 2 health bars, one for player 1 and one for player 2. For player one I have a gui group (20,30, Screen.width/2, 30). I then have the Screen.width/2 become smaller whenever player 1 takes damage and it looks similar to a fighting game when a player loses health. I want to do the same thing for player 2 but his bar needs to get smaller in the opposite direction, so his bar needs to shrink from left to right. I tried making the gui group box start at the of the screen and go to the left but it didn’t work, it seems they can only begin on the left and grow towards the right. I then figured I would just change the beginning point when Player 2 takes damage but the problem is that if I affect where it starts it pushes where it ends too. I can fix this by having a group within a group probably but I am wondering if maybe I can just flip the texture. IF any of you know how I would like to know.

In he screenshot notice how player 2’s bar doesn’t have a yellow border all the way around
24647-hpbars.png

GUI.BeginGroup(Rect(Screen.width/2 + 50, 40, (Screen.width - 20) - (Screen.width/2 + 50), 30));
       GUI.DrawTexture(Rect(0, 0, Screen.width - 20, 30), hpBarEmpty, ScaleMode.StretchToFill, true, 0);

       GUI.BeginGroup(Rect(2 * (p2HP/100), 2, (Screen.width - 20) - (Screen.width/2 + 54), 26));
         GUI.DrawTexture(Rect(0, 0, (Screen.width - 20) - (Screen.width/2 + 54), 30), hpBarFull, ScaleMode.StretchToFill, true, 0);
       GUI.EndGroup();
    GUI.EndGroup();

How about this:

private var p1HP : float = 100;
private var maxP1HP : float = 100;
private var p2HP : float = 100;
private var maxP2HP : float = 100;

var emptySize : Vector2 = Vector2(200, 20);
var fullInset : int = 5;
var inset : int = 20;

var emptyTex : Texture2D;
var fullTex : Texture2D;

function Update () {
	if(Input.GetKeyDown(KeyCode.Q)){
		p1HP--;
	}else if(Input.GetKeyDown(KeyCode.W)){
		p2HP--;
	}
}

function OnGUI(){
	var leftEmpty : Rect = Rect(inset, inset, emptySize.x, emptySize.y);
	var rightEmpty : Rect = Rect(Screen.width-(emptySize.x+inset), inset, emptySize.x, emptySize.y);
	
	//EMPTY BARS
	GUI.DrawTexture(leftEmpty, emptyTex);
	GUI.DrawTexture(rightEmpty, emptyTex);
	
	//LEFT HEALTH-BAR
	GUI.BeginGroup(Rect(
		leftEmpty.x+fullInset,
		leftEmpty.y+fullInset,
		(p1HP/maxP1HP)*(leftEmpty.width-(2*fullInset)),
		leftEmpty.height-(2*fullInset)
	));
		GUI.DrawTexture(Rect(0, 0, leftEmpty.width-(2*fullInset), leftEmpty.height-(2*fullInset)), fullTex);
	GUI.EndGroup();
	
	//RIGHT HEALTH-BAR
	GUI.BeginGroup(Rect(
		rightEmpty.x+fullInset+(((maxP2HP-p2HP)/maxP2HP)*(rightEmpty.width-(2*fullInset))),
		rightEmpty.y+fullInset,
		(p2HP/maxP2HP)*(rightEmpty.width-(2*fullInset)),
		(rightEmpty.height-(2*fullInset))
	));
		GUI.DrawTexture(Rect(0, 0, rightEmpty.width-(2*fullInset), rightEmpty.height-(2*fullInset)), fullTex);
	GUI.EndGroup();
}

you should take a look at the code after the “//RIGHT HEALTH-BAR” comment as that seems to be the part you are having trouble with.

Scribe