1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 11:52:55 +08:00
osu-lazer/osu.Game/Screens/Ranking/Contracted/ContractedPanelTopContent.cs

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

46 lines
1.3 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Ranking.Contracted
{
public class ContractedPanelTopContent : CompositeDrawable
{
public readonly Bindable<int?> ScorePosition = new Bindable<int?>();
private OsuSpriteText text;
public ContractedPanelTopContent()
{
RelativeSizeAxes = Axes.Both;
}
[BackgroundDependencyLoader]
private void load()
{
InternalChild = text = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Y = 6,
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold)
};
}
protected override void LoadComplete()
{
base.LoadComplete();
ScorePosition.BindValueChanged(pos => text.Text = pos.NewValue != null ? $"#{pos.NewValue}" : string.Empty, true);
}
}
}