Knot3.Game.Widgets.TextInputDialog.TextInputDialog C# (CSharp) Method

TextInputDialog() public method

Erstelle einen neuen TextInputDialog.
public TextInputDialog ( IScreen screen, DisplayLayer drawOrder, string title, string text, string inputText ) : System
screen IScreen
drawOrder DisplayLayer
title string
text string
inputText string
return System
        public TextInputDialog(IScreen screen, DisplayLayer drawOrder, string title, string text, string inputText)
            : base(screen, drawOrder, title)
        {
            textItem = new TextItem (screen, drawOrder, String.Empty);

            Cancel = (time) => {
                Close (time);
            };
            Submit = (time) => {
                Close (time);
            };

            Bounds.Size = new ScreenPoint (screen, 0.5f, 0.3f);
            // Der Titel-Text ist mittig ausgerichtet
            AlignX = HorizontalAlignment.Center;
            menu = new Menu (Screen, Index + DisplayLayer.Menu);
            menu.Bounds = ContentBounds;
            menu.Bounds.Padding = new ScreenPoint (screen, 0.010f, 0.019f);
            menu.ItemAlignX = HorizontalAlignment.Left;
            menu.ItemAlignY = VerticalAlignment.Center;

            //die Texteingabe
            textInput = new InputItem (Screen, Index + DisplayLayer.MenuItem, text, inputText);
            menu.Add (textInput);
            menu.Add (textItem);
            textInput.IsEnabled = true;
            textInput.IsInputEnabled = true;
            textInput.NameWidth = 0.35f;
            textInput.ValueWidth = 0.65f;

            ValidKeys.AddRange (new Keys[] { Keys.Enter, Keys.Escape });
        }