2019-01-24 08:43:03 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-03-27 10:29:27 +00:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2018-11-20 07:51:59 +00:00
|
|
|
|
using osuTK;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
|
|
|
|
{
|
|
|
|
|
public class GlowIcon : Container
|
|
|
|
|
{
|
|
|
|
|
private readonly SpriteIcon spriteIcon;
|
|
|
|
|
private readonly BlurredIcon blurredIcon;
|
|
|
|
|
|
|
|
|
|
public override Vector2 Size
|
|
|
|
|
{
|
2019-02-28 04:58:19 +00:00
|
|
|
|
get => base.Size;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
blurredIcon.Size = spriteIcon.Size = value;
|
|
|
|
|
blurredIcon.ForceRedraw();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Vector2 BlurSigma
|
|
|
|
|
{
|
2019-02-28 04:58:19 +00:00
|
|
|
|
get => blurredIcon.BlurSigma;
|
|
|
|
|
set => blurredIcon.BlurSigma = value;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-27 10:29:27 +00:00
|
|
|
|
public IconUsage Icon
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2019-02-28 04:58:19 +00:00
|
|
|
|
get => spriteIcon.Icon;
|
|
|
|
|
set => spriteIcon.Icon = blurredIcon.Icon = value;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GlowIcon()
|
|
|
|
|
{
|
|
|
|
|
RelativePositionAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
blurredIcon = new BlurredIcon
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
},
|
|
|
|
|
spriteIcon = new SpriteIcon
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Shadow = false,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
blurredIcon.Colour = colours.Blue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|