mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:42:56 +08:00
change sprite text to text flow
This commit is contained in:
parent
91e77ee4de
commit
a706ff63ed
@ -54,26 +54,30 @@ namespace osu.Game.Overlays.Wiki
|
||||
[Resolved]
|
||||
private OverlayScrollContainer scrollContainer { get; set; }
|
||||
|
||||
private readonly OsuSpriteText spriteText;
|
||||
|
||||
private readonly MarkdownHeading target;
|
||||
|
||||
private readonly OsuTextFlowContainer textFlow;
|
||||
|
||||
public TocTitle(string text, MarkdownHeading target, bool subtitle = false)
|
||||
{
|
||||
this.target = target;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Child = spriteText = new OsuSpriteText
|
||||
Child = textFlow = new OsuTextFlowContainer(t =>
|
||||
{
|
||||
Text = text,
|
||||
Font = OsuFont.GetFont(size: subtitle ? 12 : 15),
|
||||
};
|
||||
t.Font = OsuFont.GetFont(size: subtitle ? 12 : 15);
|
||||
}).With(f =>
|
||||
{
|
||||
f.AddText(text);
|
||||
f.RelativeSizeAxes = Axes.X;
|
||||
f.AutoSizeAxes = Axes.Y;
|
||||
});
|
||||
Margin = new MarginPadding { Top = subtitle ? 5 : 10 };
|
||||
Padding = new MarginPadding { Left = subtitle ? 10 : 0 };
|
||||
}
|
||||
|
||||
protected override IEnumerable<Drawable> EffectTargets => new Drawable[] { spriteText };
|
||||
protected override IEnumerable<Drawable> EffectTargets => new Drawable[] { textFlow };
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
|
Loading…
Reference in New Issue
Block a user