Ejemplo n.º 1
0
        public TextBox(string text, SpriteFont font, Rectangle textBox, Rectangle textArea, float rowSeperationAdd, float textDelay,
            TextBoxCloseMode closeMode)
        {
            //The Font.
            _Font = font;
            //The position of the TextBox.
            _SpritePosition = new Vector2(textBox.X, textBox.Y);
            //The Shape of the TextBox.
            _TextBox = ToTopLeftRectangle(textBox);
            //The shape of the TextArea.
            _TextArea = ToTopLeftRectangle(textArea);
            //The Delay of the Text.
            _TextDelay = textDelay;

            //The Sprite.
            //_Sprite = new Sprite();
            //The Font Size.
            _FontSize = ((_Font.MeasureString("tm").X + _Font.MeasureString("tm").Y) / 4);
            //The Arrow Position Multiplier.
            _MessageArrowPositionMultiplier = 1;
            //The Arrow Update Delay.
            _MessageArrowUpdateDelay = 6;
            //The TextManager.
            _TextManager = new TextManager(text, _TextArea, _FontSize, rowSeperationAdd, textDelay, closeMode);
        }
Ejemplo n.º 2
0
 //Dispose.
 public void Dispose()
 {
     //Dispose of the Sprite.
     _Sprite.Dispose();
     //Dispose of the Font.
     _Font = null;
     //Dispose of the TextManager.
     _TextManager.Exit = true;
     _TextManager = null;
 }
Ejemplo n.º 3
0
        public TextBox(string text, SpriteFont font)
        {
            //The Font.
            _Font = font;
            //The Shape of the TextBox.
            _TextBox = new Rectangle(200, 200, 200, 200);
            //The shape of the TextArea.
            _TextArea = new Rectangle(200, 200, 200, 200);
            //The position of the TextBox.
            _SpritePosition = FromTopLeftVector(_TextBox);
            //The Delay of the Text.
            _TextDelay = 3;

            //The Sprite.
            //_Sprite = new Sprite();
            //The Font Size.
            _FontSize = ((_Font.MeasureString("tm").X + _Font.MeasureString("tm").Y) / 4);
            //The Arrow Position Multiplier.
            _MessageArrowPositionMultiplier = 1;
            //The Arrow Update Delay.
            _MessageArrowUpdateDelay = 6;
            //The TextManager.
            _TextManager = new TextManager(text, _TextArea, _FontSize, 10, _TextDelay, TextBoxCloseMode.Automatic);
        }