private void OnGUI() { // Draw the title. GuiHelpers.DrawText("CALIBRATION", new Vector2(10, 10), 36, GuiHelpers.Magenta); if (IsSupportedEngineVersion()) { // Draw the "Recalibrate" button. if (GUI.Button(new Rect(10, 70, 150, 30), "Recalibrate")) { StartWaitingForCalibration(); _host.LaunchRecalibration(); } // Draw the "Test calibration" button. if (GUI.Button(new Rect(10, 110, 150, 30), "Test calibration")) { _host.LaunchCalibrationTesting(); } } else { // The current engine is not supported. GuiHelpers.DrawRequiredEngineVersionError("1.1"); } }
public static void Main(string[] args) { using (var eyeXHost = new EyeXHost()) { eyeXHost.Start(); Console.WriteLine("EYEX CONFIGURATION TOOLS"); Console.WriteLine("========================"); Console.WriteLine(); Console.WriteLine("T) Test calibration"); Console.WriteLine("G) Guest calibration"); Console.WriteLine("R) Recalibrate"); Console.WriteLine("D) Display Setup"); Console.WriteLine("P) Create Profile"); var key = Console.ReadKey(true).Key; switch (key) { case ConsoleKey.T: eyeXHost.LaunchCalibrationTesting(); break; case ConsoleKey.G: eyeXHost.LaunchGuestCalibration(); break; case ConsoleKey.R: eyeXHost.LaunchRecalibration(); break; case ConsoleKey.D: eyeXHost.LaunchDisplaySetup(); break; case ConsoleKey.P: eyeXHost.LaunchProfileCreation(); break; } } }
private void OnGUI() { if (!IsSupportedEngineVersion()) { var content = new GUIContent("This functionality requires EyeX Engine version 1.1 or higher."); // Create the font style. var style = new GUIStyle(); style.alignment = TextAnchor.MiddleCenter; style.fontSize = 18; style.normal.textColor = new Color(0.953f, 0.569f, 0.039f, 1f); // Calculate the boundaries. var height = style.CalcHeight(content, 700) + 30; var bounds = new Rect((Screen.width - 700) / 2f, Screen.height / 2f - (height / 2), 700, height); // Draw the label. GUI.Label(bounds, content, style); return; } // Draw the box surrounding the buttons. GUI.Box(new Rect(10, 10, 170, 110), "Calibration"); // Draw the "Recalibrate" button. if (GUI.Button(new Rect(20, 40, 150, 30), "Recalibrate")) { StartWaitingForCalibration(); _host.LaunchRecalibration(); } // Draw the "Test calibration" button. if (GUI.Button(new Rect(20, 80, 150, 30), "Test calibration")) { _host.LaunchCalibrationTesting(); } }