BorderLayer -> EditorPlayfieldBorder

This commit is contained in:
smoogipoo 2018-11-06 18:10:46 +09:00
parent 85f96ad62f
commit 27d82052f4
3 changed files with 33 additions and 39 deletions

View File

@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Edit
}
var layerBelowRuleset = CreateLayerContainer();
layerBelowRuleset.Child = new BorderLayer { RelativeSizeAxes = Axes.Both };
layerBelowRuleset.Child = new EditorPlayfieldBorder { RelativeSizeAxes = Axes.Both };
var layerAboveRuleset = CreateLayerContainer();
layerAboveRuleset.Child = new BlueprintContainer();

View File

@ -1,38 +0,0 @@
// 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.Containers;
using osu.Framework.Graphics.Shapes;
using OpenTK.Graphics;
namespace osu.Game.Screens.Edit.Screens.Compose.Layers
{
public class BorderLayer : Container
{
protected override Container<Drawable> Content => content;
private readonly Container content;
public BorderLayer()
{
InternalChildren = new Drawable[]
{
new Container
{
Name = "Border",
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderColour = Color4.White,
BorderThickness = 2,
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
},
content = new Container { RelativeSizeAxes = Axes.Both }
};
}
}
}

View File

@ -0,0 +1,32 @@
// 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.Containers;
using osu.Framework.Graphics.Shapes;
using OpenTK.Graphics;
namespace osu.Game.Screens.Edit.Screens.Compose.Layers
{
/// <summary>
/// Provides a border around the playfield.
/// </summary>
public class EditorPlayfieldBorder : CompositeDrawable
{
public EditorPlayfieldBorder()
{
RelativeSizeAxes = Axes.Both;
Masking = true;
BorderColour = Color4.White;
BorderThickness = 2;
InternalChild = new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
};
}
}
}