/// <summary> /// Set the default font for the game. /// </summary> /// <param name="defaultFont"></param> public static void SetDefaultFont(ICutlassFont defaultFont) { if (!defaultFont.IsLoaded) { defaultFont.LoadContent(); } _DefaultFont = defaultFont.Font; }
/// <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> /// Add a font of type ICutlassFont. /// </summary> /// <param name="newTexture"></param> public static FontId AddFont(ICutlassFont newFont) { FontId fontId; lock (_FontIdLock) { fontId = _NextFontId++; } _Fonts.Add(fontId, newFont); if (_Initialized) newFont.LoadContent(); return fontId; }
/// <summary> /// Add a font of type ICutlassFont. /// </summary> /// <param name="newTexture"></param> public static FontId AddFont(ICutlassFont newFont) { FontId fontId; lock (_FontIdLock) { fontId = _NextFontId++; } _Fonts.Add(fontId, newFont); if (_Initialized) { newFont.LoadContent(); } return(fontId); }
/// <summary> /// Set the default font for the game. /// </summary> /// <param name="defaultFont"></param> public static void SetDefaultFont(ICutlassFont defaultFont) { if (!defaultFont.IsLoaded) defaultFont.LoadContent(); _DefaultFont = defaultFont.Font; }