TextPos
How do I use Text Pos
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
104 | GUILayout.BeginArea(TextPos); | 1 |
File name: InRoomRoundTimer.cs
Copy
94 public void OnGUI()
95 {
96 // alternatively to doing this calculation here:
97 // calculate these values in Update() and make them publicly available to all other scripts
98 double elapsedTime = (PhotonNetwork.time - StartTime);
99 double remainingTime = SecondsPerTurn - (elapsedTime % SecondsPerTurn);
100 int turn = (int)(elapsedTime / SecondsPerTurn);
101
102
103 // simple gui for output
104 GUILayout.BeginArea(TextPos);
105 GUILayout.Label(string.Format("elapsed: {0:0.000}", elapsedTime));
106 GUILayout.Label(string.Format("remaining: {0:0.000}", remainingTime));
107 GUILayout.Label(string.Format("turn: {0:0}", turn));
108 if (GUILayout.Button("new round"))
109 {
110 this.StartRoundNow();
111 }
112 GUILayout.EndArea();
113 }
TextPos 138 lượt xem
Gõ tìm kiếm nhanh...