mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Add a generic text Element
Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com>
This commit is contained in:
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -16,9 +15,6 @@ using osu.Game.Graphics.Sprites;
|
|||||||
|
|
||||||
namespace osu.Game.Skinning.Components
|
namespace osu.Game.Skinning.Components
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Intended to be a test bed for skinning. May be removed at some point in the future.
|
|
||||||
/// </summary>
|
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class BeatmapInfoDrawable : Container, ISkinnableDrawable
|
public class BeatmapInfoDrawable : Container, ISkinnableDrawable
|
||||||
{
|
{
|
||||||
@ -48,12 +44,6 @@ namespace osu.Game.Skinning.Components
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// [BackgroundDependencyLoader]
|
|
||||||
// private void load(WorkingBeatmap beatmap)
|
|
||||||
// {
|
|
||||||
// this.beatmap = beatmap;
|
|
||||||
// }
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
@ -176,7 +166,7 @@ namespace osu.Game.Skinning.Components
|
|||||||
{
|
{
|
||||||
CircleSize,
|
CircleSize,
|
||||||
HPDrain,
|
HPDrain,
|
||||||
Accuracy, //OD?
|
Accuracy,
|
||||||
ApproachRate,
|
ApproachRate,
|
||||||
StarRating,
|
StarRating,
|
||||||
Song,
|
Song,
|
||||||
|
40
osu.Game/Skinning/Components/TextElement.cs
Normal file
40
osu.Game/Skinning/Components/TextElement.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
|
namespace osu.Game.Skinning.Components
|
||||||
|
{
|
||||||
|
[UsedImplicitly]
|
||||||
|
public class TextElement : Container, ISkinnableDrawable
|
||||||
|
{
|
||||||
|
public bool UsesFixedAnchor { get; set; }
|
||||||
|
|
||||||
|
[SettingSource("Displayed Text", "What text should be displayed")]
|
||||||
|
public Bindable<string> Text { get; } = new Bindable<string>("Circles!");
|
||||||
|
|
||||||
|
public TextElement()
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
OsuSpriteText text;
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
text = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Font = OsuFont.Default.With(size: 40)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
text.Current.BindTo(Text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user