2019-01-24 16:43:03 +08: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 17:19:50 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2018-03-03 23:50:41 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2017-09-22 06:16:05 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2018-03-03 23:50:41 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-03-27 18:29:27 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2017-09-21 06:44:30 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-03-03 23:50:41 +08:00
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
2017-09-21 06:44:30 +08:00
|
|
|
|
{
|
2017-09-22 06:16:05 +08:00
|
|
|
|
public class GlowIcon : Container
|
2017-09-21 06:44:30 +08:00
|
|
|
|
{
|
2017-09-22 06:16:05 +08:00
|
|
|
|
private readonly SpriteIcon spriteIcon;
|
2017-09-23 01:43:51 +08:00
|
|
|
|
private readonly BlurredIcon blurredIcon;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-21 06:44:30 +08:00
|
|
|
|
public override Vector2 Size
|
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
get => base.Size;
|
2017-09-21 06:44:30 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
2017-09-23 02:12:58 +08:00
|
|
|
|
blurredIcon.Size = spriteIcon.Size = value;
|
2017-09-23 01:43:51 +08:00
|
|
|
|
blurredIcon.ForceRedraw();
|
2017-09-21 06:44:30 +08:00
|
|
|
|
}
|
2017-09-23 01:43:51 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-23 01:43:51 +08:00
|
|
|
|
public Vector2 BlurSigma
|
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
get => blurredIcon.BlurSigma;
|
|
|
|
|
set => blurredIcon.BlurSigma = value;
|
2017-09-21 06:44:30 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-03-27 18:29:27 +08:00
|
|
|
|
public IconUsage Icon
|
2017-09-22 06:16:05 +08:00
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
get => spriteIcon.Icon;
|
|
|
|
|
set => spriteIcon.Icon = blurredIcon.Icon = value;
|
2017-09-22 06:16:05 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-22 06:16:05 +08:00
|
|
|
|
public GlowIcon()
|
2017-09-21 06:44:30 +08:00
|
|
|
|
{
|
|
|
|
|
RelativePositionAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2017-09-23 01:43:51 +08:00
|
|
|
|
blurredIcon = new BlurredIcon
|
2017-09-21 06:44:30 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
},
|
2017-09-22 06:16:05 +08:00
|
|
|
|
spriteIcon = new SpriteIcon
|
2017-09-21 06:44:30 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Shadow = false,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-21 06:44:30 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
2017-09-23 01:43:51 +08:00
|
|
|
|
blurredIcon.Colour = colours.Blue;
|
2017-09-21 06:44:30 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|