示例#1
0
        public static void InitFontOptions(ContentManager content)
        {
            string name = GuiData.ActiveFontConfig.name;

            GuiData.FontConfigs.Clear();
            GuiData.FontConfigs.Add(new GuiData.FontCongifOption()
            {
                name               = "default",
                smallFont          = content.Load <SpriteFont>("Font12"),
                tinyFont           = content.Load <SpriteFont>("Font10"),
                bigFont            = content.Load <SpriteFont>("Font23"),
                tinyFontCharHeight = 10f
            });
            if (string.IsNullOrEmpty(name))
            {
                GuiData.ActiveFontConfig = GuiData.FontConfigs[0];
            }
            GuiData.FontConfigs.Add(new GuiData.FontCongifOption()
            {
                name               = "medium",
                smallFont          = content.Load <SpriteFont>("Font14"),
                tinyFont           = content.Load <SpriteFont>("Font12"),
                bigFont            = content.Load <SpriteFont>("Font23"),
                tinyFontCharHeight = 14f
            });
            GuiData.FontConfigs.Add(new GuiData.FontCongifOption()
            {
                name               = "large",
                smallFont          = content.Load <SpriteFont>("Font16"),
                tinyFont           = content.Load <SpriteFont>("Font14"),
                bigFont            = content.Load <SpriteFont>("Font23"),
                tinyFontCharHeight = 16f
            });
            bool flag = false;

            for (int index = 0; index < GuiData.FontConfigs.Count; ++index)
            {
                if (GuiData.FontConfigs[index].name == name)
                {
                    GuiData.ActivateFontConfig(GuiData.FontConfigs[index]);
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                GuiData.ActivateFontConfig(GuiData.FontConfigs[0]);
            }
            if (GuiData.LocaleFontConfigs.ContainsKey("en-us"))
            {
                return;
            }
            GuiData.LocaleFontConfigs.Add("en-us", GuiData.FontConfigs);
        }
示例#2
0
 public static void ActivateFontConfig(GuiData.FontCongifOption config)
 {
     if (config.detailFont != null)
     {
         GuiData.detailfont = config.detailFont;
     }
     GuiData.smallfont        = config.smallFont;
     GuiData.tinyfont         = config.tinyFont;
     GuiData.font             = config.bigFont;
     GuiData.ActiveFontConfig = config;
 }
示例#3
0
 public static void ActivateFontConfig(GuiData.FontCongifOption config);