mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:13:34 +08:00
Make gradient layer a bit more dynamic
This commit is contained in:
parent
a3639e0ce3
commit
357e55ae1f
@ -39,6 +39,8 @@ namespace osu.Game.Screens.Menu
|
||||
private UpdateableOnlineBeatmapSetCover cover = null!;
|
||||
private IBindable<DailyChallengeInfo?> info = null!;
|
||||
|
||||
private Box gradientLayer = null!;
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; } = null!;
|
||||
|
||||
@ -74,10 +76,10 @@ namespace osu.Game.Screens.Menu
|
||||
Origin = Anchor.Centre,
|
||||
RelativePositionAxes = Axes.Both,
|
||||
},
|
||||
new Box
|
||||
gradientLayer = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = ColourInfo.GradientVertical(accentColour.Opacity(0), accentColour),
|
||||
Colour = ColourInfo.GradientVertical(accentColour.Opacity(0.2f), accentColour),
|
||||
Blending = BlendingParameters.Additive,
|
||||
},
|
||||
new Box
|
||||
@ -117,6 +119,10 @@ namespace osu.Game.Screens.Menu
|
||||
RNG.NextSingle(-0.5f, 0.5f) * (scale - 1),
|
||||
RNG.NextSingle(-0.5f, 0.5f) * (scale - 1)
|
||||
), duration, Easing.InOutSine);
|
||||
|
||||
gradientLayer.FadeIn(duration / 2)
|
||||
.Then()
|
||||
.FadeOut(duration / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user