//Creates a textbox and adds the text sent in into the textbuffer before reading from the config file
        public TextBox(SpriteFont font, Rectangle rect, string text, bool origin)
        {
            configFile = null;

            spriteFont = font;

            textBoxPosX = rect.X;
            textBoxPosY = rect.Y;

            textBoxRect = rect;
            textBuffer  = TextUtils.RemoveTextBetween(text, '{', '}');
            useOrigin   = origin;
        }
Exemple #2
0
 public void SetMessage(params string[] text)
 {
     foreach (string str in text)
     {
         if (!str.Contains('#'))
         {
             textBuffer.Add(TextUtils.RemoveTextBetween(str, '{', '}'));
         }
         else
         {
             List <String> tempList = TextUtils.SplitHashTagText(str);
             foreach (string str2 in tempList)
             {
                 textBuffer.Add(TextUtils.RemoveTextBetween(str2, '{', '}'));
             }
         }
     }
 }
        //Reads text from the config file and stores string formatted as a list
        public void LoadFormattedText(string section, List <string> variableList, List <string> textList)
        {
            if (textList != null)
            {
                for (int i = 0; i < textList.Count; i++)
                {
                    textBuffer += textList[i] + ": " + configFile.GetPropertyAsString(section, variableList[i], "") + "\n\n";
                }
            }

            else
            {
                for (int i = 0; i < variableList.Count; i++)
                {
                    textBuffer += configFile.GetPropertyAsString(section, variableList[i], "") + "\n\n";
                }
            }

            textBuffer = TextUtils.RemoveTextBetween(textBuffer, '{', '}');
        }
 public void SetText(String text)
 {
     textBuffer = TextUtils.RemoveTextBetween(text, '{', '}');
 }
 //Reads text from the config file
 public void LoadText(string section, string variable)
 {
     textBuffer += configFile.GetPropertyAsString(section, variable, "");
     textBuffer  = TextUtils.RemoveTextBetween(textBuffer, '{', '}');
 }