Example #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;
 }
Example #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;
        }
Example #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);
            }
        }
Example #4
0
 /// <summary>
 /// Get a font
 /// </summary>
 /// <param name="textureId"></param>
 /// <returns></returns>
 public static ICutlassFont GetFont(FontId fontId)
 {
     return _Fonts.ElementAtOrDefault(fontId).Value;
 }
Example #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;
 }