private void load(OsuColour colours) { SelectedColour = colours.Green; DeselectedColour = SelectedColour.Opacity(0.5f); Text = @"random"; Action = () => { if (rewindSearch) { const double fade_time = 500; OsuSpriteText rewindSpriteText; TextContainer.Add(rewindSpriteText = new OsuSpriteText { Alpha = 0, Text = @"rewind", AlwaysPresent = true, // make sure the button is sized large enough to always show this Anchor = Anchor.Centre, Origin = Anchor.Centre, }); rewindSpriteText.FadeOutFromOne(fade_time, Easing.In); rewindSpriteText.MoveTo(Vector2.Zero).MoveTo(new Vector2(0, 10), fade_time, Easing.In); rewindSpriteText.Expire(); SpriteText.FadeInFromZero(fade_time, Easing.In); PreviousRandom.Invoke(); } else { NextRandom.Invoke(); } }; }
private void load(OsuColour colours) { SelectedColour = colours.Green; DeselectedColour = SelectedColour.Opacity(0.5f); TextContainer.Add(persistentText = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AlwaysPresent = true, AutoSizeAxes = Axes.Both, Children = new[] { randomSpriteText = new OsuSpriteText { AlwaysPresent = true, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "random", }, rewindSpriteText = new OsuSpriteText { AlwaysPresent = true, Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "rewind", Alpha = 0f, } } }); Action = () => { if (rewindSearch) { const double fade_time = 500; OsuSpriteText fallingRewind; TextContainer.Add(fallingRewind = new OsuSpriteText { Alpha = 0, Text = rewindSpriteText.Text, AlwaysPresent = true, // make sure the button is sized large enough to always show this Anchor = Anchor.Centre, Origin = Anchor.Centre, }); fallingRewind.FadeOutFromOne(fade_time, Easing.In); fallingRewind.MoveTo(Vector2.Zero).MoveTo(new Vector2(0, 10), fade_time, Easing.In); fallingRewind.Expire(); persistentText.FadeInFromZero(fade_time, Easing.In); PreviousRandom.Invoke(); } else { NextRandom.Invoke(); } }; }