Exemplo n.º 1
0
        public LegacySpriteText(ISkin skin, LegacyFont font)
        {
            Shadow = false;
            UseFullGlyphHeight = false;

            Font = new FontUsage(skin.GetFontPrefix(font), 1, fixedWidth: true);
            Spacing = new Vector2(-skin.GetFontOverlap(font), 0);

            glyphStore = new LegacyGlyphStore(skin);
        }
Exemplo n.º 2
0
        public static float GetFontOverlap(this ISkin source, LegacyFont font)
        {
            switch (font)
            {
            case LegacyFont.Score:
                return(source.GetConfig <LegacySetting, float>(LegacySetting.ScoreOverlap)?.Value ?? 0f);

            case LegacyFont.Combo:
                return(source.GetConfig <LegacySetting, float>(LegacySetting.ComboOverlap)?.Value ?? 0f);

            case LegacyFont.HitCircle:
                return(source.GetConfig <LegacySetting, float>(LegacySetting.HitCircleOverlap)?.Value ?? -2f);

            default:
                throw new ArgumentOutOfRangeException(nameof(font));
            }
        }
Exemplo n.º 3
0
        public static string GetFontPrefix(this ISkin source, LegacyFont font)
        {
            switch (font)
            {
            case LegacyFont.Score:
                return(source.GetConfig <LegacySetting, string>(LegacySetting.ScorePrefix)?.Value ?? "score");

            case LegacyFont.Combo:
                return(source.GetConfig <LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score");

            case LegacyFont.HitCircle:
                return(source.GetConfig <LegacySetting, string>(LegacySetting.HitCirclePrefix)?.Value ?? "default");

            default:
                throw new ArgumentOutOfRangeException(nameof(font));
            }
        }
Exemplo n.º 4
0
 public LegacySpriteText(LegacyFont font)
 {
     this.font          = font;
     Shadow             = false;
     UseFullGlyphHeight = false;
 }
Exemplo n.º 5
0
 public static bool HasFont(this ISkin source, LegacyFont font)
 {
     return(source.GetTexture($"{source.GetFontPrefix(font)}-0") != null);
 }
Exemplo n.º 6
0
 public LegacyRollingCounter(LegacyFont font)
 {
     this.font = font;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a new <see cref="LegacyRollingCounter"/>.
 /// </summary>
 /// <param name="skin">The <see cref="ISkin"/> from which to get counter number sprites.</param>
 /// <param name="font">The legacy font to use for the counter.</param>
 public LegacyRollingCounter(ISkin skin, LegacyFont font)
 {
     this.skin = skin;
     this.font = font;
 }