Exemple #1
0
        public void addText(int xPos, int yPos, string text, Color color, BasicFonts font = BasicFonts.CG_14_REGULAR)
        {
            BasicText textToAdd = new BasicText(xPos, yPos, getSpriteFont(font), text, color);

            componentsOnScreen.Add(textToAdd);
            textLabelsOnScreen.Add(textToAdd);
        }
Exemple #2
0
        public void addTextCenteredHorizontal(int xPos, int yPos, string text, Color color, BasicFonts font = BasicFonts.CG_14_REGULAR)
        {
            BasicText textToAdd = new BasicText(xPos, yPos, getSpriteFont(font), text, Color.White, StringAlignment.CENTER);

            componentsOnScreen.Add(textToAdd);
            textLabelsOnScreen.Add(textToAdd);
        }
Exemple #3
0
 private SpriteFont getSpriteFont(BasicFonts font)
 {
     switch (font)
     {
         case BasicFonts.CG_14_REGULAR:
             return this.buttonFontStyle1;
         case BasicFonts.CG_12_REGULAR:
             return this.buttonFontStyle2;
         default:
             return this.buttonFontStyle1;
     }
 }