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

47 lines
1.2 KiB
C#
Raw Normal View History

2017-09-20 22:44:30 +00:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Game.Graphics;
namespace osu.Game.Screens.Play.BreaksOverlay
{
public class BlurredIcon : BufferedContainer
{
2017-09-21 22:16:05 +00:00
private const int blur_sigma = 20;
2017-09-20 22:44:30 +00:00
2017-09-21 22:16:05 +00:00
private readonly GlowIcon icon;
2017-09-20 22:44:30 +00:00
public FontAwesome Icon
{
set { icon.Icon = value; }
get { return icon.Icon; }
}
2017-09-21 22:16:05 +00:00
public override Vector2 Size
{
set
{
icon.Size = value;
base.Size = value + new Vector2(blur_sigma * 2);
}
get { return icon.Size; }
}
2017-09-20 22:44:30 +00:00
public BlurredIcon()
{
RelativePositionAxes = Axes.X;
2017-09-21 22:16:05 +00:00
BlurSigma = new Vector2(blur_sigma);
2017-09-20 22:44:30 +00:00
Alpha = 0.6f;
CacheDrawnFrameBuffer = true;
2017-09-21 22:16:05 +00:00
Child = icon = new GlowIcon
2017-09-20 22:44:30 +00:00
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
};
}
}
}