How to display text from a text object to another text object?
hi guys,
i made a 2d game and on the right side of the screen the score and highscore are displayed.I did this with first making a canvas and in the canvas, I made a text object. In the canvas I also made an object called 'gameover'. In this object i made a gameover screen with a panel. (This works)
the actual problem is I made a text object in my gameover object and i want the score and highscore to be displayed in that text object. So when the gameover screen comes the same scores are displayed.
How can i do that in a easy way?
Answer by ClearRoseOfWar · Jan 07, 2016 at 01:24 AM
int TheHighscore; //this would be your highscore int
void OnGUI(){
int XPos = 10;
int YPos = 10;
int TextboxSizeX = 100;
int TextboxSizeY = 20;
GUI.Label(new Rect(XPos, YPos, TextboxSizeX, TextboxSizeY), TheHighscore.ToString());
}
Your answer
Follow this Question
Related Questions
Making text appear by pressing a button, only when player is close to the object 1 Answer
Problems with raycasting 2D. Probelmas com raycasting 2D. 0 Answers
How to link up instantiated text in list to allow buttons to adjust number shown, c# 1 Answer
Can anybody tell me how to display text on axis? 1 Answer
Pipe Game Water Flow 0 Answers