1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 14:47:23 +08:00
osu-lazer/osu.Game/Screens/Edit/Compose/Components/Timeline/HitObjectPointPiece.cs

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

62 lines
1.8 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.
2022-06-17 15:37:17 +08:00
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK.Graphics;
2023-04-26 00:12:53 +08:00
namespace osu.Game.Screens.Edit.Compose.Components.Timeline;
public partial class HitObjectPointPiece : CircularContainer
{
2023-04-26 00:12:53 +08:00
protected OsuSpriteText Label { get; private set; }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
2023-04-26 00:12:53 +08:00
AutoSizeAxes = Axes.Both;
2023-04-26 00:12:53 +08:00
Color4 colour = GetRepresentingColour(colours);
2023-04-26 00:12:53 +08:00
InternalChildren = new Drawable[]
{
2023-04-26 00:12:53 +08:00
new Container
{
2023-04-26 00:12:53 +08:00
AutoSizeAxes = Axes.X,
Height = 16,
Masking = true,
CornerRadius = 8,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Children = new Drawable[]
{
2023-04-26 00:12:53 +08:00
new Box
{
Colour = colour,
RelativeSizeAxes = Axes.Both,
},
Label = new OsuSpriteText
{
2023-04-26 00:12:53 +08:00
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Padding = new MarginPadding(5),
Font = OsuFont.Default.With(size: 12, weight: FontWeight.SemiBold),
Colour = colours.B5,
}
2023-04-26 00:12:53 +08:00
}
},
};
2023-04-26 00:17:07 +08:00
}
2023-04-26 00:12:53 +08:00
protected virtual Color4 GetRepresentingColour(OsuColour colours)
{
return colours.Yellow;
}
}