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); }
public TextManager(string text, Rectangle box, float fontSize, float rowSeperationAdd, float textDelay, TextBoxCloseMode closeMode) { //The Textbox. _TextBox = box; //The Main text. _MainText = text; //The Cloned Text. _TextClone = _MainText; //The Current Word. _CurrentWord = _TextClone.Substring(0, _TextClone.IndexOf(" ")); //The Index. _Index = 0; //The Current Row. _CurrentRow = 0; //The Update Delay. _UpdateDelay = 3; //The WaitForInput bool. _WaitForInput = false; //The way the TextBox should close. _TextBoxCloseMode = closeMode; //Initialize the TextList. _TextList = new List<string>(); //Fill the TextList. _TextList.Add(""); //The Font Size. _FontSize = fontSize; //The Row Seperation Add. _RowSeperation = rowSeperationAdd; }