Basic overlay layout implementation

This commit is contained in:
Andrei Zavatski
2020-04-16 11:01:36 +03:00
parent 5ec8d49241
commit ef0da9e3e8
3 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,62 @@
// 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.Shapes;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Dashboard;
namespace osu.Game.Overlays
{
public class DashboardOverlay : FullscreenOverlay
{
private readonly Box background;
private readonly Container content;
public DashboardOverlay()
: base(OverlayColourScheme.Purple)
{
Children = new Drawable[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both
},
new OverlayScrollContainer
{
RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false,
Child = new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new DashboardOverlayHeader
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Depth = -float.MaxValue
},
content = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y
}
}
}
},
new LoadingLayer(content),
};
}
[BackgroundDependencyLoader]
private void load()
{
background.Colour = ColourProvider.Background5;
}
}
}