- Home /
Ammo GUI Display Bottom Right of Screen?
var bulletHudTexture : Texture;
var ammoCountRect : Rect = Rect(25,25,50,25);
var ammoStartX : int = 100;
var ammoY : int = 25;
var ammoSize : Vector2 = Vector2(2.316,15);
var ammoSpacing : float = 3;
var ammoDecorationHudRect : Rect = Rect(25,50,50,25);
var ammoDecorationTexture : Texture;
function OnGUI ()
{
if (beingHeld)
{
if (ammoDecorationTexture)
GUI.DrawTexture( ammoDecorationHudRect, ammoDecorationTexture);
for (var i : int = 1; i <= currentClip; i++)
{
GUI.DrawTexture(Rect(ammoStartX + ((i - 1) * (ammoSize.x + ammoSpacing)), ammoY, ammoSize.x, ammoSize.y), bulletHudTexture);
}
GUI.Label(ammoCountRect, currentClip.ToString() + "/" + currentExtraAmmo.ToString());
}
}
How do I use Screen.height and Screen.width to make the GUI in the bottom right corner instead of the top left corner.
Comment
Answer by Artaani · Sep 27, 2013 at 10:44 AM
new Rect (Screen.width - 200, Screen.height - 40, 200, 40)
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
GUI displayed only when firing 1 Answer
How do I get my Ammo Hud on the bottom right of the screen? 1 Answer
gui help for ammo display 1 Answer
Gui text, ammo counter 1 Answer