1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 12:30:30 +08:00
Files
osu-lazer/osu.Game.Rulesets.Shape/Objects/Drawables/Pieces/X.cs
T
2018-03-19 12:07:10 -04:00

102 lines
3.5 KiB
C#

using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
namespace osu.Game.Rulesets.Shape.Objects.Drawables.Pieces
{
public class ShapeX : Container
{
private BaseShape shape;
private Container line1;
private Container line1Glow;
private Container line2;
public ShapeX(BaseShape Shape)
{
shape = Shape;
}
protected override void LoadComplete()
{
base.LoadComplete();
Children = new Drawable[]
{
line1 = new Container
{
Rotation = 360 - 45,
Size = new Vector2(shape.ShapeSize / 6 , shape.ShapeSize),
Masking = true,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Depth = -2,
Colour = Color4.White,
Children = new[]
{
new Box
{
AlwaysPresent = true,
Alpha = 1,
RelativeSizeAxes = Axes.Both
},
},
},
line2 = new Container
{
Rotation = 45,
Size = new Vector2(shape.ShapeSize / 6 , shape.ShapeSize),
Masking = true,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Depth = -1,
Colour = Color4.White,
Children = new[]
{
new Box
{
AlwaysPresent = true,
Alpha = 1,
RelativeSizeAxes = Axes.Both
},
},
EdgeEffect = new EdgeEffectParameters
{
Hollow = true,
Type = EdgeEffectType.Shadow,
Colour = Color4.White.Opacity(0.25f),
Radius = shape.ShapeSize / 4,
}
},
line1Glow = new Container
{
Rotation = 360 - 45,
Size = new Vector2(shape.ShapeSize / 6 , shape.ShapeSize),
Masking = true,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Depth = 0,
Colour = Color4.White,
Children = new[]
{
new Box
{
AlwaysPresent = true,
Alpha = 0,
RelativeSizeAxes = Axes.Both
},
},
EdgeEffect = new EdgeEffectParameters
{
Hollow = true,
Type = EdgeEffectType.Shadow,
Colour = Color4.White.Opacity(0.25f),
Radius = shape.ShapeSize / 4,
}
},
};
}
}
}