mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:57:36 +08:00
Add elastic scale on appear
This commit is contained in:
parent
9bec53bfa8
commit
fdfd82aec4
@ -14,10 +14,12 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
public class OsuPopover : Popover
|
public class OsuPopover : Popover
|
||||||
{
|
{
|
||||||
private const float fade_duration = 250;
|
private const float fade_duration = 250;
|
||||||
|
private const double scale_duration = 500;
|
||||||
|
|
||||||
public OsuPopover(bool withPadding = true)
|
public OsuPopover(bool withPadding = true)
|
||||||
{
|
{
|
||||||
Content.Padding = withPadding ? new MarginPadding(20) : new MarginPadding();
|
Content.Padding = withPadding ? new MarginPadding(20) : new MarginPadding();
|
||||||
|
|
||||||
Body.Masking = true;
|
Body.Masking = true;
|
||||||
Body.CornerRadius = 10;
|
Body.CornerRadius = 10;
|
||||||
Body.Margin = new MarginPadding(10);
|
Body.Margin = new MarginPadding(10);
|
||||||
@ -38,7 +40,16 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
|
|
||||||
protected override Drawable CreateArrow() => Empty();
|
protected override Drawable CreateArrow() => Empty();
|
||||||
|
|
||||||
protected override void PopIn() => this.FadeIn(fade_duration, Easing.OutQuint);
|
protected override void PopIn()
|
||||||
protected override void PopOut() => this.FadeOut(fade_duration, Easing.OutQuint);
|
{
|
||||||
|
this.ScaleTo(1, scale_duration, Easing.OutElasticHalf);
|
||||||
|
this.FadeIn(fade_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PopOut()
|
||||||
|
{
|
||||||
|
this.ScaleTo(0.7f, scale_duration, Easing.OutQuint);
|
||||||
|
this.FadeOut(fade_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user