Пример #1
0
        public static Texture[] AddFont(FontInfo font)
        {
            if (sheetsLoaded)
            {
                throw new Exception($"Unable to add font (name: {font.FontName}). Sheets are already loaded.");
            }

            var data     = FontLoader.LoadCharacters(font);
            var textures = new Texture[data.Length];

            for (int i = 0; i < data.Length; i++)
            {
                textures[i] = addTexture(data[i], font.FontName, font.CharSizes[i].X, font.CharSizes[i].Y);
            }

            return(textures);
        }