1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 04:49:40 +08:00
osu-lazer/osu.Game/Screens/Play/BreaksOverlay/BlurredIcon.cs

52 lines
1.3 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-09-21 06:44:30 +08:00
// 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;
2017-09-23 01:43:51 +08:00
using osu.Framework.Allocation;
2017-09-21 06:44:30 +08:00
namespace osu.Game.Screens.Play.BreaksOverlay
{
public class BlurredIcon : BufferedContainer
{
2017-09-23 01:43:51 +08:00
private readonly SpriteIcon icon;
2017-09-21 06:44:30 +08:00
public FontAwesome Icon
{
set { icon.Icon = value; }
get { return icon.Icon; }
}
2017-09-22 06:16:05 +08:00
public override Vector2 Size
{
set
{
icon.Size = value;
2017-09-23 01:43:51 +08:00
base.Size = value + BlurSigma * 2.5f;
ForceRedraw();
2017-09-22 06:16:05 +08:00
}
2017-09-23 01:43:51 +08:00
get { return base.Size; }
2017-09-22 06:16:05 +08:00
}
2017-09-21 06:44:30 +08:00
public BlurredIcon()
{
RelativePositionAxes = Axes.X;
CacheDrawnFrameBuffer = true;
2017-09-23 01:43:51 +08:00
Child = icon = new SpriteIcon
2017-09-21 06:44:30 +08:00
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
2017-09-23 01:43:51 +08:00
Shadow = false,
2017-09-21 06:44:30 +08:00
};
}
2017-09-23 01:43:51 +08:00
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.BlueLighter;
}
2017-09-21 06:44:30 +08:00
}
}