Пример #1
0
        private void updateTexture()
        {
            var loadableIcon = icon;

            if (Equals(loadableIcon, loadedIcon))
            {
                return;
            }

            var texture = store.GetCharacter(loadableIcon.FontName, Icon.Icon);

            spriteMain.Texture   = texture;
            spriteShadow.Texture = texture;

            if (Size == Vector2.Zero)
            {
                Size = new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0);
            }

            loadedIcon = loadableIcon;
        }
Пример #2
0
        private void updateTexture()
        {
            var loadableIcon = icon;

            if (loadableIcon.Equals(loadedIcon))
            {
                return;
            }

            var glyph = store.Get(loadableIcon.FontName, Icon.Icon);

            if (glyph != null)
            {
                spriteMain.Texture   = glyph.Texture;
                spriteShadow.Texture = glyph.Texture;

                if (Size == Vector2.Zero)
                {
                    Size = new Vector2(glyph.Width, glyph.Height);
                }
            }

            loadedIcon = loadableIcon;
        }