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); }
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); }
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; } }