Пример #1
0
 /// <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;
 }
Пример #2
0
        /// <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;
        }
Пример #3
0
        /// <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);
            }
        }
Пример #4
0
 /// <summary>
 /// Get a font
 /// </summary>
 /// <param name="textureId"></param>
 /// <returns></returns>
 public static ICutlassFont GetFont(FontId fontId)
 {
     return _Fonts.ElementAtOrDefault(fontId).Value;
 }
Пример #5
0
 /// <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;
 }