2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-09-16 00:39:55 +08:00
|
|
|
|
// 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;
|
2018-03-03 23:50:41 +08:00
|
|
|
|
using OpenTK.Graphics;
|
2017-09-16 00:39:55 +08:00
|
|
|
|
|
2018-03-03 23:50:41 +08:00
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
2017-09-16 00:39:55 +08:00
|
|
|
|
{
|
2018-03-03 23:50:41 +08:00
|
|
|
|
public class LetterboxOverlay : CompositeDrawable
|
2017-09-16 00:39:55 +08:00
|
|
|
|
{
|
2017-09-27 06:10:48 +08:00
|
|
|
|
private const int height = 350;
|
2017-09-16 00:39:55 +08:00
|
|
|
|
|
2017-09-27 06:10:48 +08:00
|
|
|
|
private static readonly Color4 transparent_black = new Color4(0, 0, 0, 0);
|
2017-09-16 00:39:55 +08:00
|
|
|
|
|
|
|
|
|
public LetterboxOverlay()
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
2018-03-03 23:50:41 +08:00
|
|
|
|
InternalChildren = new Drawable[]
|
2017-09-16 00:39:55 +08:00
|
|
|
|
{
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopLeft,
|
|
|
|
|
Origin = Anchor.TopLeft,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2017-09-27 06:10:48 +08:00
|
|
|
|
Height = height,
|
2017-09-16 00:39:55 +08:00
|
|
|
|
Child = new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-10-18 10:06:17 +08:00
|
|
|
|
Colour = ColourInfo.GradientVertical(Color4.Black, transparent_black),
|
2017-09-16 00:39:55 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2017-09-27 06:10:48 +08:00
|
|
|
|
Height = height,
|
2017-09-16 00:39:55 +08:00
|
|
|
|
Child = new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-10-18 10:06:17 +08:00
|
|
|
|
Colour = ColourInfo.GradientVertical(transparent_black, Color4.Black),
|
2017-09-16 00:39:55 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-09-21 06:44:30 +08:00
|
|
|
|
}
|