Exemplo n.º 1
0
        public static void Game1LoadContentPostfix(Game __instance)
        {
            ModManager.CurLanguage = Hacknet.Settings.ActiveLocale;
            Main.FontName.Clear();
            foreach (var i in settings.FontList)
            {
                Main.FontName.Add(i.Translate());
            }
            Font font;

            if (CurSpriteFont10 == null)
            {
                font            = new Font(FontName[settings.CurFont], 10, FontStyle.Bold);
                CurSpriteFont10 = new SpriteFontX(font, (IGraphicsDeviceService)__instance.Content.ServiceProvider.GetService(typeof(IGraphicsDeviceService)), System.Drawing.Text.TextRenderingHint.SystemDefault);
            }
            if (CurSpriteFont12 == null)
            {
                font            = new Font(FontName[settings.CurFont], 12, FontStyle.Bold);
                CurSpriteFont12 = new SpriteFontX(font, (IGraphicsDeviceService)__instance.Content.ServiceProvider.GetService(typeof(IGraphicsDeviceService)), System.Drawing.Text.TextRenderingHint.SystemDefault);
            }
            if (CurSpriteFont23 == null)
            {
                font            = new Font(FontName[settings.CurFont], 23, FontStyle.Bold);
                CurSpriteFont23 = new SpriteFontX(font, (IGraphicsDeviceService)__instance.Content.ServiceProvider.GetService(typeof(IGraphicsDeviceService)), System.Drawing.Text.TextRenderingHint.SystemDefault);
            }
            if (CurSpriteFont7 == null)
            {
                font           = new Font(FontName[settings.CurFont], 7, FontStyle.Bold);
                CurSpriteFont7 = new SpriteFontX(font, (IGraphicsDeviceService)__instance.Content.ServiceProvider.GetService(typeof(IGraphicsDeviceService)), System.Drawing.Text.TextRenderingHint.SystemDefault);
            }
        }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
 public static Vector2 DrawStringX(this SpriteBatch sb, SpriteFontX sfx, string str, Vector2 position, Color color)
 {
     return(sfx.Draw(sb, str, position, color));
 }