1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 01:57:19 +08:00

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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