1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Adjust osu! logo metrics and add shockwave impact animation

This commit is contained in:
Dean Herbert 2017-05-15 19:36:03 +09:00
parent fa889c4340
commit 23760d6805
3 changed files with 45 additions and 5 deletions

@ -1 +1 @@
Subproject commit b90c4ed490f76f2995662b3a8af3a32b8756a012 Subproject commit ffccbeb98dc9e8f0965520270b5885e63f244c83

View File

@ -245,8 +245,14 @@ namespace osu.Game.Screens.Menu
buttonArea.FadeIn(300); buttonArea.FadeIn(300);
if (lastState == MenuState.Initial) if (lastState == MenuState.Initial)
{
buttonArea.Delay(150, true); buttonArea.Delay(150, true);
if (osuLogo.Scale.X > 0.5f)
using (osuLogo.BeginDelayedSequence(200, true))
osuLogo.Impact();
}
Scheduler.AddDelayed(() => toolbar?.Show(), 150); Scheduler.AddDelayed(() => toolbar?.Show(), 150);
foreach (Button b in buttonsTopLevel) foreach (Button b in buttonsTopLevel)

View File

@ -35,7 +35,7 @@ namespace osu.Game.Screens.Menu
public Action Action; public Action Action;
public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.78f; public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.74f;
private readonly Sprite ripple; private readonly Sprite ripple;
@ -63,8 +63,14 @@ namespace osu.Game.Screens.Menu
public bool Interactive = true; public bool Interactive = true;
private readonly Box flashLayer; private readonly Box flashLayer;
private readonly Container impactContainer;
private const float default_size = 480;
public OsuLogo() public OsuLogo()
{ {
Size = new Vector2(default_size);
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
@ -92,7 +98,7 @@ namespace osu.Game.Screens.Menu
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Scale = new Vector2(0.8f), Scale = new Vector2(0.88f),
Masking = true, Masking = true,
Children = new Drawable[] Children = new Drawable[]
{ {
@ -137,6 +143,7 @@ namespace osu.Game.Screens.Menu
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
ripple = new Sprite ripple = new Sprite
@ -148,11 +155,30 @@ namespace osu.Game.Screens.Menu
} }
} }
}, },
impactContainer = new CircularContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Alpha = 0,
BorderColour = Color4.White,
RelativeSizeAxes = Axes.Both,
BorderThickness = 10,
Masking = true,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
AlwaysPresent = true,
Alpha = 0,
}
}
},
new MenuVisualisation new MenuVisualisation
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = logo.Size, RelativeSizeAxes = Axes.Both,
BlendingMode = BlendingMode.Additive, BlendingMode = BlendingMode.Additive,
Alpha = 0.2f, Alpha = 0.2f,
} }
@ -211,7 +237,8 @@ namespace osu.Game.Screens.Menu
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
if (!Interactive) return false; if (!Interactive) return false;
logoHoverContainer.ScaleTo(1.2f, 500, EasingTypes.OutElastic);
logoHoverContainer.ScaleTo(1.1f, 500, EasingTypes.OutElastic);
return true; return true;
} }
@ -219,5 +246,12 @@ namespace osu.Game.Screens.Menu
{ {
logoHoverContainer.ScaleTo(1, 500, EasingTypes.OutElastic); logoHoverContainer.ScaleTo(1, 500, EasingTypes.OutElastic);
} }
public void Impact()
{
impactContainer.FadeOutFromOne(250, EasingTypes.In);
impactContainer.ScaleTo(0.96f);
impactContainer.ScaleTo(1.12f, 250);
}
} }
} }