2019-01-24 17:43:03 +09: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 18:19:50 +09:00
|
|
|
|
|
2018-03-04 00:50:41 +09:00
|
|
|
|
using osu.Framework.Allocation;
|
2017-09-21 01:44:30 +03:00
|
|
|
|
using osu.Framework.Graphics;
|
2018-03-04 00:50:41 +09:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-03-27 19:29:27 +09:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2017-09-21 01:44:30 +03:00
|
|
|
|
using osu.Game.Graphics;
|
2018-11-20 16:51:59 +09:00
|
|
|
|
using osuTK;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2018-03-04 00:50:41 +09:00
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
2017-09-21 01:44:30 +03:00
|
|
|
|
{
|
|
|
|
|
public partial class BlurredIcon : BufferedContainer
|
|
|
|
|
{
|
2017-09-22 20:43:51 +03:00
|
|
|
|
private readonly SpriteIcon icon;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2019-03-27 19:29:27 +09:00
|
|
|
|
public IconUsage Icon
|
2017-09-21 01:44:30 +03:00
|
|
|
|
{
|
2019-02-28 13:58:19 +09:00
|
|
|
|
set => icon.Icon = value;
|
|
|
|
|
get => icon.Icon;
|
2017-09-21 01:44:30 +03:00
|
|
|
|
}
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2017-09-22 01:16:05 +03:00
|
|
|
|
public override Vector2 Size
|
|
|
|
|
{
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
icon.Size = value;
|
2023-05-05 14:29:03 +09:00
|
|
|
|
base.Size = value + BlurSigma * 5;
|
2017-09-22 20:43:51 +03:00
|
|
|
|
ForceRedraw();
|
2017-09-22 01:16:05 +03:00
|
|
|
|
}
|
2019-02-28 13:58:19 +09:00
|
|
|
|
get => base.Size;
|
2017-09-22 01:16:05 +03:00
|
|
|
|
}
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2017-09-21 01:44:30 +03:00
|
|
|
|
public BlurredIcon()
|
2021-11-05 15:54:27 +09:00
|
|
|
|
: base(cachedFrameBuffer: true)
|
2017-09-21 01:44:30 +03:00
|
|
|
|
{
|
|
|
|
|
RelativePositionAxes = Axes.X;
|
2017-09-22 20:43:51 +03:00
|
|
|
|
Child = icon = new SpriteIcon
|
2017-09-21 01:44:30 +03:00
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Anchor = Anchor.Centre,
|
2017-09-22 20:43:51 +03:00
|
|
|
|
Shadow = false,
|
2017-09-21 01:44:30 +03:00
|
|
|
|
};
|
|
|
|
|
}
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2017-09-22 20:43:51 +03:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
Colour = colours.BlueLighter;
|
|
|
|
|
}
|
2017-09-21 01:44:30 +03:00
|
|
|
|
}
|
|
|
|
|
}
|