1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 14:07:25 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs

56 lines
1.7 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using OpenTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
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
{
get { return number.Text; }
set { number.Text = value; }
}
public NumberPiece()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Children = new Drawable[]
{
new SkinnableDrawable("Play/osu/number-glow", name => new CircularContainer
{
Masking = true,
Origin = Anchor.Centre,
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Radius = 60,
Colour = Color4.White.Opacity(0.5f),
},
Child = new Box()
}, s => s.GetTexture("Play/osu/hitcircle") == null),
2018-09-27 15:27:11 +08:00
number = new SkinnableSpriteText("Play/osu/number-text", _ => new OsuSpriteText
2018-04-13 17:19:50 +08:00
{
Font = @"Venera",
UseFullGlyphHeight = false,
TextSize = 40,
2018-09-27 15:27:11 +08:00
}, restrictSize: false)
{
Text = @"1"
2018-04-13 17:19:50 +08:00
}
};
}
}
}