Made the sample Log window a little more compact.
@@ -157,17 +157,21 @@ class App
/// Here's the code for the window, and log tracking.
static Pose logPose = new Pose(0, -0.1f, 0.5f, Quat.LookDir(Vec3.Forward));
static List<string> logList = new List<string>();
+ static string logText = "";
static void OnLog(LogLevel level, string text)
{
- if (logList.Count > 10)
+ if (logList.Count > 15)
logList.RemoveAt(logList.Count - 1);
- logList.Insert(0, text.Length < 100 ? text : text.Substring(0,100)+"...");
+ logList.Insert(0, text.Length < 100 ? text : text.Substring(0,100)+"...\n");
+
+ logText = "";
+ for (int i = 0; i < logList.Count; i++)
+ logText += logList[i];
}
static void LogWindow()
{
UI.WindowBegin("Log", ref logPose, new Vec2(40, 0) * U.cm);
- for (int i = 0; i < logList.Count; i++)
- UI.Label(logList[i], false);
+ UI.Text(logText);
UI.WindowEnd();
}
/// :End:
