2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
2017-03-04 18:42:37 +00:00
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
2016-11-17 08:20:51 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-04-02 05:51:28 +00:00
|
|
|
|
using osu.Framework.Graphics.Effects;
|
2019-02-12 04:04:46 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2020-12-04 11:21:53 +00:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2018-02-22 08:33:47 +00:00
|
|
|
|
using osu.Game.Skinning;
|
2020-12-04 11:21:53 +00:00
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-12-04 11:21:53 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
2016-11-17 08:20:51 +00:00
|
|
|
|
{
|
|
|
|
|
public class NumberPiece : Container
|
|
|
|
|
{
|
2018-09-27 07:27:11 +00:00
|
|
|
|
private readonly SkinnableSpriteText number;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-02-15 14:23:55 +00:00
|
|
|
|
public string Text
|
|
|
|
|
{
|
2021-02-22 08:14:00 +00:00
|
|
|
|
get => number.Text.ToString();
|
2019-02-28 04:58:19 +00:00
|
|
|
|
set => number.Text = value;
|
2017-02-15 14:23:55 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2016-11-17 08:20:51 +00:00
|
|
|
|
public NumberPiece()
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-02-15 14:23:55 +00:00
|
|
|
|
Children = new Drawable[]
|
2016-11-17 08:20:51 +00:00
|
|
|
|
{
|
2019-10-29 13:31:27 +00:00
|
|
|
|
new Container
|
2017-02-15 14:23:55 +00:00
|
|
|
|
{
|
2017-03-22 06:27:22 +00:00
|
|
|
|
Masking = true,
|
2017-06-12 03:48:47 +00:00
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
2017-02-15 14:23:55 +00:00
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Glow,
|
|
|
|
|
Radius = 60,
|
|
|
|
|
Colour = Color4.White.Opacity(0.5f),
|
|
|
|
|
},
|
2019-08-30 05:39:02 +00:00
|
|
|
|
},
|
|
|
|
|
number = new SkinnableSpriteText(new OsuSkinComponent(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
|
2016-11-17 08:20:51 +00:00
|
|
|
|
{
|
2019-02-22 10:42:09 +00:00
|
|
|
|
Font = OsuFont.Numeric.With(size: 40),
|
2017-02-15 14:23:55 +00:00
|
|
|
|
UseFullGlyphHeight = false,
|
2019-07-18 03:10:28 +00:00
|
|
|
|
}, confineMode: ConfineMode.NoScaling)
|
2018-09-27 07:27:11 +00:00
|
|
|
|
{
|
|
|
|
|
Text = @"1"
|
2016-11-17 08:20:51 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-05 11:21:19 +00:00
|
|
|
|
}
|