예제 #1
0
        /// <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;
        }
예제 #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>
        /// 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;
        }
예제 #4
0
        /// <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);
        }
예제 #5
0
        /// <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;
        }