I’m very new to unity, heavy web background experience.
What I’m trying to do is create a menu bar along the top of the screen where aligned to the right side is “Score: 99”, “Health: 100%”, and a Pause button. The score/health text would be an image. Each item would be evenly spaced (say 25px) but when the score count increases to 999 or 9999 that block would shift over to the left a little more to keep the 25px spacing.
In HTML, it’s a matter of simple {content}, I have no idea how I’d achieve this in csharp, can someone help me out?
For anyone else, with the help of the commenters above I’ve fitured out how to create a top menu used for score / timers /etc with dynamic and fixed width spacing:
GUILayout.BeginArea(new Rect (Screen.width-275, 0, 250, 25));
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace(); // basically right align the top menu bar
GUILayout.Label(displaySeconds.ToString(),FontStyle);
GUILayout.Space(35); // fixed width between timer and score
GUILayout.Label(score.ToString(),FontStyle);
GUILayout.EndHorizontal();
GUILayout.EndArea();