mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +08:00
Allow custom font to be used in OsuCheckbox
This commit is contained in:
parent
b2f1e133f8
commit
3148bbda2a
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.Containers;
|
||||
@ -57,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
labelText = new OsuTextFlowContainer
|
||||
labelText = new OsuTextFlowContainer(ApplyLabelParameters)
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -84,6 +85,13 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Current.DisabledChanged += disabled => labelText.Alpha = Nub.Alpha = disabled ? 0.3f : 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A function which can be overridden to change the parameters of the label's text.
|
||||
/// </summary>
|
||||
protected virtual void ApplyLabelParameters(SpriteText text)
|
||||
{
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user