![]()
I have a XP bar in my game and on that XP bar I want to display some text (“curXp / maxXp”) but my text ends up in the background and not the foreground as I want it to. How can I fix this?
![]()
I have a XP bar in my game and on that XP bar I want to display some text (“curXp / maxXp”) but my text ends up in the background and not the foreground as I want it to. How can I fix this?
Oh… here’s my code:
void OnGUI()
{
if(Event.current.type.Equals(EventType.Repaint))
{
Graphics.DrawTexture(new Rect(166, (Screen.height - 40), 468, 29), XPBar);
Graphics.DrawTexture(new Rect(175, (Screen.height - 23), GetPercentInToLevel() * 468f, 5), XPFill);
XPText.text = GetCurrentXp() + " / " + LevelMaxXP[GetCurrentLevel()];
}
}
I figured it out… I’ll have to use GUI.Label instead… but that gives me another issue. How do I return the string size in pixels?