2020-01-27 12:36:19 +00:00
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
|
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.Overlays
|
|
|
|
|
{
|
|
|
|
|
public partial class OverlayHeaderBackground : CompositeDrawable
|
|
|
|
|
{
|
|
|
|
|
public OverlayHeaderBackground(string textureName)
|
|
|
|
|
{
|
|
|
|
|
Height = 80;
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
Masking = true;
|
2022-11-17 14:55:40 +00:00
|
|
|
|
InternalChild = new DelayedLoadWrapper(() => new Background(textureName));
|
2020-01-27 12:36:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private partial class Background : Sprite
|
|
|
|
|
{
|
|
|
|
|
private readonly string textureName;
|
|
|
|
|
|
|
|
|
|
public Background(string textureName)
|
|
|
|
|
{
|
|
|
|
|
this.textureName = textureName;
|
|
|
|
|
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
FillMode = FillMode.Fill;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2022-11-17 14:55:40 +00:00
|
|
|
|
private void load(LargeTextureStore textures)
|
2020-01-27 12:36:19 +00:00
|
|
|
|
{
|
|
|
|
|
Texture = textures.Get(textureName);
|
|
|
|
|
}
|
2022-11-17 14:55:40 +00:00
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
this.FadeInFromZero(500, Easing.OutQuint);
|
|
|
|
|
}
|
2020-01-27 12:36:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|