Exemplo n.º 1
0
        public KeyBinding(SpriteFont font, ContentManager content, Vector2 textPosition, Vector2 binderPosition, string text, Keys boundKey)
        {
            Text2DParams textParams = new Text2DParams()
            {
                Font        = font,
                Position    = textPosition,
                WrittenText = text,
                LightColour = Constants.TEXT_COLOUR
            };

            this.text = new Text2D(textParams);

            KeyBindingTextBoxParams binderParams = new KeyBindingTextBoxParams()
            {
                Content     = content,
                Font        = font,
                LightColour = Constants.TEXT_COLOUR,
                Position    = binderPosition,
                Scale       = new Vector2(250f, 1f),
                Text        = KeyLists.translate(boundKey),
                BoundTo     = boundKey,
                TextColour  = Constants.TEXT_COLOUR
            };

            this.keyBinder = new KeyBindingTextBox(binderParams);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructs a KeyBindingTextBox
 /// </summary>
 /// <param name="parms">KeyBindingTextBoxParams object containing the data required to construct the object</param>
 public KeyBindingTextBox(KeyBindingTextBoxParams parms)
     : base(parms)
 {
     this.previousText = parms.Text;
     this.BoundTo      = parms.BoundTo;
 }