1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 14:23:06 +08:00

Make the background strip expand from the disc edges.

This commit is contained in:
DrabWeb 2017-06-23 23:51:28 -03:00
parent 3c97f04826
commit c71f34c507

View File

@ -33,7 +33,7 @@ namespace osu.Game.Overlays
private const float border_width = 5; private const float border_width = 5;
private readonly Box background; private readonly Box background;
private readonly FillFlowContainer backgroundStrip; private readonly Container backgroundStrip;
private readonly BackgroundStrip leftStrip, rightStrip; private readonly BackgroundStrip leftStrip, rightStrip;
private readonly CircularContainer disc; private readonly CircularContainer disc;
private readonly Sprite innerSpin, outterSpin; private readonly Sprite innerSpin, outterSpin;
@ -72,22 +72,46 @@ namespace osu.Game.Overlays
Size = new Vector2(DISC_SIZE + 500), Size = new Vector2(DISC_SIZE + 500),
Alpha = 0f, Alpha = 0f,
}, },
backgroundStrip = new FillFlowContainer backgroundStrip = new Container
{ {
Name = @"background strip", Name = @"background strip",
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Width = 0f,
Height = border_width, Height = border_width,
Alpha = 0f, Alpha = 0f,
Direction = FillDirection.Horizontal,
Children = new[] Children = new[]
{ {
leftStrip = new BackgroundStrip(0f, 1f), new Container
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.CentreRight,
Width = 0.5f,
Padding = new MarginPadding { Right = DISC_SIZE / 2 },
Children = new[]
{
leftStrip = new BackgroundStrip(0f, 1f)
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
},
},
},
new Container
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.CentreLeft,
Width = 0.5f,
Padding = new MarginPadding { Left = DISC_SIZE / 2 },
Children = new[]
{
rightStrip = new BackgroundStrip(1f, 0f), rightStrip = new BackgroundStrip(1f, 0f),
}, },
}, },
},
},
disc = new CircularContainer disc = new CircularContainer
{ {
Name = @"content", Name = @"content",
@ -187,12 +211,13 @@ namespace osu.Game.Overlays
}); });
disc.FadeIn(duration1); disc.FadeIn(duration1);
backgroundStrip.FadeIn(duration1);
backgroundStrip.ResizeWidthTo(1f, duration1 * 2, EasingTypes.OutQuint);
outterSpin.FadeTo(0.1f, duration1 * 2); outterSpin.FadeTo(0.1f, duration1 * 2);
disc.ScaleTo(1f, duration1 * 2, EasingTypes.OutElastic); disc.ScaleTo(1f, duration1 * 2, EasingTypes.OutElastic);
Delay(duration1 + 200, true); Delay(duration1 + 200, true);
backgroundStrip.FadeIn(duration2);
leftStrip.ResizeWidthTo(1f, duration2, EasingTypes.OutQuint);
rightStrip.ResizeWidthTo(1f, duration2, EasingTypes.OutQuint);
drawableMedal.ChangeState(DrawableMedal.DisplayState.Icon, duration2); drawableMedal.ChangeState(DrawableMedal.DisplayState.Icon, duration2);
Delay(duration2, true); Delay(duration2, true);
@ -220,7 +245,7 @@ namespace osu.Game.Overlays
public BackgroundStrip(float start, float end) public BackgroundStrip(float start, float end)
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Width = 0.5f; Width = 0f;
ColourInfo = ColourInfo.GradientHorizontal(Color4.White.Opacity(start), Color4.White.Opacity(end)); ColourInfo = ColourInfo.GradientHorizontal(Color4.White.Opacity(start), Color4.White.Opacity(end));
Masking = true; Masking = true;