1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 11:47:24 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Skinning/Default/NumberPiece.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.6 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 17:19:50 +08:00
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2019-04-02 13:51:28 +08:00
using osu.Framework.Graphics.Effects;
using osu.Game.Graphics;
2020-12-04 19:21:53 +08:00
using osu.Game.Graphics.Sprites;
2018-02-22 16:33:47 +08:00
using osu.Game.Skinning;
2020-12-04 19:21:53 +08:00
using osuTK.Graphics;
2018-04-13 17:19:50 +08:00
2020-12-04 19:21:53 +08:00
namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public partial class NumberPiece : Container
{
2018-09-27 15:27:11 +08:00
private readonly SkinnableSpriteText number;
2018-04-13 17:19:50 +08:00
2017-02-15 22:23:55 +08:00
public string Text
{
get => number.Text.ToString();
set => number.Text = value;
2017-02-15 22:23:55 +08:00
}
2018-04-13 17:19:50 +08:00
public NumberPiece()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
2018-04-13 17:19:50 +08:00
2017-02-15 22:23:55 +08:00
Children = new Drawable[]
{
new Container
2017-02-15 22:23:55 +08:00
{
Masking = true,
2017-06-12 11:48:47 +08:00
EdgeEffect = new EdgeEffectParameters
2017-02-15 22:23:55 +08:00
{
Type = EdgeEffectType.Glow,
Radius = 60,
Colour = Color4.White.Opacity(0.5f),
},
},
number = new SkinnableSpriteText(new OsuSkinComponentLookup(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
{
Font = OsuFont.Numeric.With(size: 40),
2017-02-15 22:23:55 +08:00
UseFullGlyphHeight = false,
}, confineMode: ConfineMode.NoScaling)
2018-09-27 15:27:11 +08:00
{
Text = @"1"
}
};
}
}
2018-01-05 19:21:19 +08:00
}