Add glow and bling to game mode selector.

This commit is contained in:
Dean Herbert 2016-12-01 19:15:34 +09:00
parent 3a5c41b970
commit 918a3bc74f
2 changed files with 36 additions and 4 deletions

View File

@ -2,8 +2,10 @@
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Modes;
using OpenTK.Graphics;
namespace osu.Game.Overlays.Toolbar
{
@ -26,7 +28,23 @@ namespace osu.Game.Overlays.Toolbar
{
set
{
//Background.Colour = value ? new Color4(100, 100, 100, 255) : new Color4(20, 20, 20, 255);
if (value)
{
DrawableIcon.Colour = Color4.White;
DrawableIcon.Masking = true;
DrawableIcon.EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Colour = new Color4(255, 194, 224, 100),
Radius = 15,
Roundness = 15,
};
}
else
{
DrawableIcon.Masking = false;
DrawableIcon.Colour = new Color4(255, 194, 224, 255);
}
}
}

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Toolbar
const float padding = 10;
private FlowContainer modeButtons;
private Box modeButtonLine;
private Drawable modeButtonLine;
private ToolbarModeButton activeButton;
public Action<PlayMode> OnPlayModeChange;
@ -42,13 +42,27 @@ namespace osu.Game.Overlays.Toolbar
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = 10, Right = 10 },
},
modeButtonLine = new Box
modeButtonLine = new Container
{
RelativeSizeAxes = Axes.X,
Size = new Vector2(0.3f, 3),
Anchor = Anchor.BottomLeft,
Origin = Anchor.TopLeft,
Colour = Color4.White
Masking = true,
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Colour = new Color4(255, 194, 224, 100),
Radius = 15,
Roundness = 15,
},
Children = new []
{
new Box
{
RelativeSizeAxes = Axes.Both,
}
}
}
};