2019-01-24 16:43:03 +08:00
|
|
|
|
// 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;
|
2019-02-12 12:04:46 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2020-12-04 19:21:53 +08:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2018-04-13 17:19:50 +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
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
public class NumberPiece : Container
|
|
|
|
|
{
|
2018-09-27 15:27:11 +08:00
|
|
|
|
private readonly SkinnableSpriteText number;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
public string Text
|
|
|
|
|
{
|
2021-02-22 16:14:00 +08:00
|
|
|
|
get => number.Text.ToString();
|
2019-02-28 12:58:19 +08:00
|
|
|
|
set => number.Text = value;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public NumberPiece()
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2019-10-29 21:31:27 +08:00
|
|
|
|
new Container
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Masking = true,
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Glow,
|
|
|
|
|
Radius = 60,
|
|
|
|
|
Colour = Color4.White.Opacity(0.5f),
|
|
|
|
|
},
|
2019-08-30 13:39:02 +08:00
|
|
|
|
},
|
2022-11-09 13:11:41 +08:00
|
|
|
|
number = new SkinnableSpriteText(new OsuSkinLookup(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-02-22 18:42:09 +08:00
|
|
|
|
Font = OsuFont.Numeric.With(size: 40),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
UseFullGlyphHeight = false,
|
2019-07-18 11:10:28 +08:00
|
|
|
|
}, confineMode: ConfineMode.NoScaling)
|
2018-09-27 15:27:11 +08:00
|
|
|
|
{
|
|
|
|
|
Text = @"1"
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|