/// <summary> /// Set font for all menu entries /// </summary> /// <param name="fontKey"></param> public void SetMenuEntryFont(FontId fontId) { foreach (MenuEntry entry in MenuEntries) entry.Entry_Id = fontId; }
/// <summary> /// Get a SpriteFont object /// </summary> /// <param name="fontName"></param> /// <returns></returns> public static SpriteFont GetSpriteFont(FontId fontId) { ICutlassFont font = GetFont(fontId); if (font != null) return font.Font; else return null; }
/// <summary> /// Remove a font. /// </summary> /// <param name="fontId"></param> public static void RemoveFont(FontId fontId) { ICutlassFont fontToRemove; _Fonts.TryGetValue(fontId, out fontToRemove); if (fontToRemove != null) { if (_Initialized) fontToRemove.UnloadContent(); _Fonts.Remove(fontId); } }
/// <summary> /// Get a font /// </summary> /// <param name="textureId"></param> /// <returns></returns> public static ICutlassFont GetFont(FontId fontId) { return _Fonts.ElementAtOrDefault(fontId).Value; }
/// <summary> /// Get a SpriteFont, or return the default font if not found. /// </summary> /// <param name="fontName"></param> /// <returns></returns> public static SpriteFont GetSpriteFontOrDefault(FontId fontId) { return GetSpriteFont(fontId) ?? DefaultFont; }