public static bool DrawStringPrefixCover(SpriteFont spriteFont, string text, Vector2 position, Microsoft.Xna.Framework.Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) { if ((text == null && text.Length == 0)) { return(true); } bool hasChineseWord = false; foreach (char i in text) { if (IsChinese(i)) { hasChineseWord = true; break; } } if (!hasChineseWord) { return(true); } if (spriteFont.GetHashCode() == GuiData.tinyfont.GetHashCode()) { CurSpriteFont10.Draw(GuiData.spriteBatch, text, position, color, rotation, origin, scale, effects, layerDepth); } else if (spriteFont.GetHashCode() == GuiData.smallfont.GetHashCode()) { CurSpriteFont12.Draw(GuiData.spriteBatch, text, position, color, rotation, origin, scale, effects, layerDepth); } else if (spriteFont.GetHashCode() == GuiData.font.GetHashCode()) { CurSpriteFont23.Draw(GuiData.spriteBatch, text, position, color, rotation, origin, scale, effects, layerDepth); } else if (spriteFont.GetHashCode() == GuiData.detailfont.GetHashCode()) { CurSpriteFont7.Draw(GuiData.spriteBatch, text, position, color, rotation, origin, scale, effects, layerDepth); } else { return(true); } return(false); }
public static Vector2 DrawStringX(this SpriteBatch sb, SpriteFontX sfx, char[] str, Vector2 position, Vector2 maxBound, Vector2 scale, Color color) { return(sfx.Draw(sb, str, position, maxBound, scale, color)); }
public static Vector2 DrawStringX(this SpriteBatch sb, SpriteFontX sfx, string str, Vector2 position, Color color) { return(sfx.Draw(sb, str, position, color)); }