Add back customisable header logo/text

Also adds test scene for MatchHeader component.
This commit is contained in:
Dean Herbert
2020-03-12 14:06:40 +09:00
parent 190ff97486
commit b6b802e821
5 changed files with 206 additions and 83 deletions

View File

@ -2,17 +2,36 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
namespace osu.Game.Tournament.Components
{
public class DrawableTournamentHeaderText : Sprite
public class DrawableTournamentHeaderText : CompositeDrawable
{
[BackgroundDependencyLoader]
private void load(TextureStore textures)
public DrawableTournamentHeaderText()
{
Texture = textures.Get("header-text");
InternalChild = new TextSprite();
Height = 25;
RelativeSizeAxes = Axes.X;
}
private class TextSprite : Sprite
{
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
RelativeSizeAxes = Axes.Both;
FillMode = FillMode.Fit;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Texture = textures.Get("header-text");
}
}
}
}