public static void ActivateFontConfig(FontCongifOption config) { smallfont = config.smallFont; tinyfont = config.tinyFont; font = config.bigFont; ActiveFontConfig = config; }
public static void InitFontOptions(ContentManager content) { var str = ActiveFontConfig.name; FontConfigs.Add(new FontCongifOption { name = "default", smallFont = content.Load <SpriteFont>("Font12"), tinyFont = content.Load <SpriteFont>("Font10"), bigFont = content.Load <SpriteFont>("Font23"), tinyFontCharHeight = 10f }); if (string.IsNullOrEmpty(str)) { ActiveFontConfig = FontConfigs[0]; } FontConfigs.Add(new FontCongifOption { name = "medium", smallFont = content.Load <SpriteFont>("Font14"), tinyFont = content.Load <SpriteFont>("Font12"), bigFont = content.Load <SpriteFont>("Font23"), tinyFontCharHeight = 14f }); FontConfigs.Add(new FontCongifOption { name = "large", smallFont = content.Load <SpriteFont>("Font16"), tinyFont = content.Load <SpriteFont>("Font14"), bigFont = content.Load <SpriteFont>("Font23"), tinyFontCharHeight = 16f }); var flag = false; for (var index = 0; index < FontConfigs.Count; ++index) { if (FontConfigs[index].name == str) { ActivateFontConfig(FontConfigs[index]); flag = true; break; } } if (flag) { return; } ActivateFontConfig(FontConfigs[0]); }
public static void InitFontOptions(ContentManager content) { var str = ActiveFontConfig.name; FontConfigs.Add(new FontCongifOption { name = "default", smallFont = content.Load<SpriteFont>("Font12"), tinyFont = content.Load<SpriteFont>("Font10"), bigFont = content.Load<SpriteFont>("Font23"), tinyFontCharHeight = 10f }); if (string.IsNullOrEmpty(str)) ActiveFontConfig = FontConfigs[0]; FontConfigs.Add(new FontCongifOption { name = "medium", smallFont = content.Load<SpriteFont>("Font14"), tinyFont = content.Load<SpriteFont>("Font12"), bigFont = content.Load<SpriteFont>("Font23"), tinyFontCharHeight = 14f }); FontConfigs.Add(new FontCongifOption { name = "large", smallFont = content.Load<SpriteFont>("Font16"), tinyFont = content.Load<SpriteFont>("Font14"), bigFont = content.Load<SpriteFont>("Font23"), tinyFontCharHeight = 16f }); var flag = false; for (var index = 0; index < FontConfigs.Count; ++index) { if (FontConfigs[index].name == str) { ActivateFontConfig(FontConfigs[index]); flag = true; break; } } if (flag) return; ActivateFontConfig(FontConfigs[0]); }
public static void ActivateFontConfig(FontCongifOption config) { smallfont = config.smallFont; tinyfont = config.tinyFont; font = config.bigFont; ActiveFontConfig = config; }