Add drop shadows to main menu buttons.

This commit is contained in:
Dean Herbert
2016-11-30 14:38:45 +09:00
parent d65a275e32
commit 5101297f53
3 changed files with 33 additions and 3 deletions

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.Menu
public class Button : Container, IStateful<ButtonState>
{
private Container iconText;
private Box box;
private Container box;
private Color4 colour;
private TextAwesome icon;
private string internalName;
@ -51,15 +51,31 @@ namespace osu.Game.Screens.Menu
Children = new Drawable[]
{
box = new Box
box = new Container
{
Masking = true,
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Shadow,
Colour = new Color4(0, 0, 0, 0.2f),
Roundness = 5,
Radius = 8,
},
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Colour = colour,
Scale = new Vector2(0, 1),
Size = boxSize,
Shear = new Vector2(ButtonSystem.wedge_width / boxSize.Y, 0),
EdgeSmoothness = new Vector2(2, 0),
Children = new Drawable[]
{
new Box
{
EdgeSmoothness = new Vector2(2, 0),
RelativeSizeAxes = Axes.Both,
},
}
},
iconText = new Container
{