osu/osu.Game/Screens/Play/Break/BlurredIcon.cs

53 lines
1.3 KiB
C#
Raw Normal View History

// 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;
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 BlurredIcon : BufferedContainer
{
private readonly SpriteIcon icon;
public IconUsage Icon
2018-04-13 09:19:50 +00:00
{
set => icon.Icon = value;
get => icon.Icon;
2018-04-13 09:19:50 +00:00
}
public override Vector2 Size
{
set
{
icon.Size = value;
base.Size = value + BlurSigma * 2.5f;
ForceRedraw();
}
get => base.Size;
2018-04-13 09:19:50 +00:00
}
public BlurredIcon()
{
RelativePositionAxes = Axes.X;
CacheDrawnFrameBuffer = true;
Child = icon = new SpriteIcon
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Shadow = false,
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.BlueLighter;
}
}
}