Пример #1
0
        public bool RegisterFont(string name, byte[] fontData, int textureSize)
        {
            try
            {
                if (name == null)
                {
                    LogUtils.DoErrorLog($"RegisterFont: FONT NAME CANNOT BE NULL!!");
                    return(false);
                }

                if (m_fontRegistered.ContainsKey(name))
                {
                    m_fontRegistered[name].Reset(1, 1);
                }
                m_fontRegistered[name] = DynamicSpriteFont.FromTtf(fontData, name, FontSizeEffective, textureSize, textureSize);
            }
            catch (FontCreationException)
            {
                LogUtils.DoErrorLog($"RegisterFont: Error creating the font \"{name}\"... Invalid data!");
                return(false);
            }
            return(true);
        }
 public static float DrawString(this SpriteBatch batch, DynamicSpriteFont font,
                                string _string_, Vector2 pos, Color color)
 {
     return(font.DrawString(batch, _string_, pos, color));
 }
 public static float DrawString(this SpriteBatch batch, DynamicSpriteFont font, string text, Vector2 pos, Color color, float depth = 0.0f)
 {
     return(font.DrawString(batch, text, pos, color, depth));
 }
 public static float DrawString(this SpriteBatch batch, DynamicSpriteFont font, StringBuilder text, Vector2 pos, Color[] glyphColors, float depth = 0.0f)
 {
     return(font.DrawString(batch, text, pos, glyphColors, depth));
 }
 public static float DrawString(this SpriteBatch batch, DynamicSpriteFont font, StringBuilder text, Vector2 pos, Color color, Vector2 scale)
 {
     return(font.DrawString(batch, text, pos, color, scale));
 }
 public static float DrawString(this SpriteBatch batch, DynamicSpriteFont font, string text, Vector2 pos, Color[] glyphColors, Vector2 scale)
 {
     return(font.DrawString(batch, text, pos, glyphColors, scale));
 }
Пример #7
0
 public static float DrawString(this SpriteBatch batch, DynamicSpriteFont font, StringBuilder stringBuilder,
                                Vector2 pos, Color color, Vector2 origin, Vector2 scale, SpriteEffects spriteEffects, float depth)
 {
     return(font.DrawString(batch, stringBuilder, pos, depth, color, origin, scale, spriteEffects));
 }