コード例 #1
0
        public NameCreation(CharacterCreation parent, CharacterCreationOutput output)
        {
            myParent = parent;
            myOutput = output;

            var label = new UILabel(Font.Large, new Vector2(4, 24))
            {
                Text = "Name:"
            };

            AddChild(label);

            myTextbox = new UITextBox(new Vector2(200 - 70 - 2, 20), new Vector2(70, 20))
            {
                Text = "Player"
            };
            AddChild(myTextbox);

            var button = new UIButton(new Vector2(100, 20), new Vector2(100 - 4, 80 - 4))
            {
                Text       = "Next",
                CentreText = true
            };

            button.Click += new MouseButtonEventHandler(button_Click);
            AddChild(button);

            CanResize = true;
            SetSize(200, 100);

            myTextbox.Focus();
        }
コード例 #2
0
    private void debugPrompt()
    {
        if (p_DebugPrompt)
        {
            return;
        }

        p_DebugPrompt           = true;
        p_DebugTextBox.Location = new Point(
            (p_Window.ClientSize.Width / 2) - (p_DebugTextBox.Width / 2),
            (p_Window.ClientSize.Height / 2) - (p_DebugTextBox.Height / 2));
        p_DebugTextBox.Text    = "";
        p_DebugTextBox.Visible = true;
        p_DebugTextBox.Focus();
    }
コード例 #3
0
 public void FocusOnInput()
 {
     Focus();
     myTextBox.Focus();
 }