mirror of
https://github.com/ppy/osu
synced 2024-12-13 02:17:32 +00:00
51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Colour;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Framework.Graphics.Shapes;
|
|
using OpenTK.Graphics;
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
|
{
|
|
public class LetterboxOverlay : CompositeDrawable
|
|
{
|
|
private const int height = 350;
|
|
|
|
private static readonly Color4 transparent_black = new Color4(0, 0, 0, 0);
|
|
|
|
public LetterboxOverlay()
|
|
{
|
|
RelativeSizeAxes = Axes.Both;
|
|
InternalChildren = new Drawable[]
|
|
{
|
|
new Container
|
|
{
|
|
Anchor = Anchor.TopLeft,
|
|
Origin = Anchor.TopLeft,
|
|
RelativeSizeAxes = Axes.X,
|
|
Height = height,
|
|
Child = new Box
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Colour = ColourInfo.GradientVertical(Color4.Black, transparent_black),
|
|
}
|
|
},
|
|
new Container
|
|
{
|
|
Anchor = Anchor.BottomLeft,
|
|
Origin = Anchor.BottomLeft,
|
|
RelativeSizeAxes = Axes.X,
|
|
Height = height,
|
|
Child = new Box
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Colour = ColourInfo.GradientVertical(transparent_black, Color4.Black),
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|