1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 05:27:26 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs

55 lines
1.5 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-05-18 18:40:20 +08:00
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
2017-04-18 15:05:58 +08:00
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
2017-05-18 18:40:20 +08:00
public class SpinnerBackground : CircularContainer, IHasAccentColour
{
public override bool HandleInput => false;
2017-05-18 18:40:20 +08:00
protected Sprite Disc;
public Color4 AccentColour
{
get { return Disc.Colour; }
set { Disc.Colour = value; }
}
public SpinnerBackground()
{
RelativeSizeAxes = Axes.Both;
Masking = true;
Children = new Drawable[]
{
Disc = new Box
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Alpha = 1,
},
};
}
2017-05-18 20:04:09 +08:00
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Radius = 14,
Colour = colours.BlueLight.Opacity(0.3f),
};
}
}
}