i am new at unity, how to add location in float values in gui ? in following i want to add location of ** x (25.78) and y (25.98) ** but there is an error,
public class GUITest : MonoBehaviour {
void OnGUI () {
GUI.Label (new Rect (25, 25, 100, 30), "Label");
}
}
Are you simply trying to add a text label to something on screen? GUI.Label draws a box and the Rect numbers define its size. You may need to clarify.
i am making risk game (global do$$anonymous$$ation) in unity, need help to display number of armies on each country, there are 42 sprites of countries how can i display number of armies separately on each country ? i am new at unity
Answer by tanoshimi · Apr 21, 2017 at 08:57 AM
GUI coordinates are provided in screen pixels, and pixels can't be subdivided. It's impossible to draw something 25.78 pixels in from the edge of the screen - it's either 25 or 26.
is there any other way to display number at specific location ? i am making risk game (global do$$anonymous$$ation) in unity, need help to display number of armies on each country, there are 42 sprites of countries how can i display number of armies separately on each country ?