Beispiel #1
0
        public InfiniConsole()
        {
            consoleWindow = new Window(InterfaceManager.GetFreeWindowID(), new Rect(10, 10, Screen.width / 2, Screen.height - 20), "Console");
            InterfaceManager.AddWindow(consoleWindow);

            TextArea consoleTextArea = new TextArea(new Rect(20, 30, consoleWindow.windowRegion.width - 40, consoleWindow.windowRegion.height - 90), Logger.GetBuffer());

            consoleText = consoleTextArea;
            consoleWindow.AddControl(consoleTextArea);

            TextField consoleTextField = new TextField(new Rect(20, consoleWindow.windowRegion.height - 50, consoleWindow.windowRegion.width - 40, 30), consoleCommand);

            consoleTextField.AddKeytrap(KeyCode.Return);
            consoleTextField.OnTrapkeyPressed += new OnTextFieldTrapkeyPressed(consoleTextField_OnTrapkeyPressed);
            consoleWindow.AddControl(consoleTextField);

            Logger.OnUpate += new OnLogUpdate(Logger_OnUpate);
        }
Beispiel #2
0
 /// <summary>
 /// Remove the window from the interface stack
 /// </summary>
 public void Dispose()
 {
     InterfaceManager.RemoveWindow(this);
 }