protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); circle.Rotation = disc.Rotation; ticks.Rotation = disc.Rotation; float relativeCircleScale = spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight; disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, EasingTypes.OutQuint); symbol.RotateTo(disc.Rotation / 2, 500, EasingTypes.OutQuint); }
protected override void LoadComplete() { base.LoadComplete(); using (spinner.BeginLoopedSequence()) spinner.RotateTo(360, 2000); }
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) { base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); if (!IsHovered) { return; } bool rightward = beatIndex % 2 == 1; double duration = timingPoint.BeatLength / 2; icon.RotateTo(rightward ? 10 : -10, duration * 2, Easing.InOutSine); icon.Animate( i => i.MoveToY(-10, duration, Easing.Out), i => i.ScaleTo(1, duration, Easing.Out) ).Then( i => i.MoveToY(0, duration, Easing.In), i => i.ScaleTo(new Vector2(1, 0.9f), duration, Easing.In) ); }
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) { base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); if (!IsHovered) { return; } bool rightward = beatIndex % 2 == 1; double duration = timingPoint.BeatLength / 2; icon.RotateTo(rightward ? 10 : -10, duration * 2, EasingTypes.InOutSine); icon.MoveToY(-10, duration, EasingTypes.Out); icon.ScaleTo(Vector2.One, duration, EasingTypes.Out); using (icon.BeginDelayedSequence(duration)) { icon.MoveToY(0, duration, EasingTypes.In); icon.ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.In); } }
protected override bool OnHover(InputState state) { if (State != ButtonState.Expanded) { return(true); } //if (OsuGame.Instance.IsActive) // Game.Audio.PlaySamplePositional($@"menu-{internalName}-hover", @"menuclick"); box.ScaleTo(new Vector2(1.5f, 1), 500, EasingTypes.OutElastic); int duration = 0; //(int)(Game.Audio.BeatLength / 2); if (duration == 0) { duration = 250; } icon.ClearTransformations(); icon.ScaleTo(1, 500, EasingTypes.OutElasticHalf); double offset = 0; //(1 - Game.Audio.SyncBeatProgress) * duration; double startTime = Time.Current + offset; icon.RotateTo(10, offset, EasingTypes.InOutSine); icon.ScaleTo(new Vector2(1, 0.9f), offset, EasingTypes.Out); icon.Transforms.Add(new TransformRotation { StartValue = -10, EndValue = 10, StartTime = startTime, EndTime = startTime + duration * 2, Easing = EasingTypes.InOutSine, LoopCount = -1, LoopDelay = duration * 2 }); icon.Transforms.Add(new TransformPosition { StartValue = Vector2.Zero, EndValue = new Vector2(0, -10), StartTime = startTime, EndTime = startTime + duration, Easing = EasingTypes.Out, LoopCount = -1, LoopDelay = duration }); icon.Transforms.Add(new TransformScale { StartValue = new Vector2(1, 0.9f), EndValue = Vector2.One, StartTime = startTime, EndTime = startTime + duration, Easing = EasingTypes.Out, LoopCount = -1, LoopDelay = duration }); icon.Transforms.Add(new TransformPosition { StartValue = new Vector2(0, -10), EndValue = Vector2.Zero, StartTime = startTime + duration, EndTime = startTime + duration * 2, Easing = EasingTypes.In, LoopCount = -1, LoopDelay = duration }); icon.Transforms.Add(new TransformScale { StartValue = Vector2.One, EndValue = new Vector2(1, 0.9f), StartTime = startTime + duration, EndTime = startTime + duration * 2, Easing = EasingTypes.In, LoopCount = -1, LoopDelay = duration }); icon.Transforms.Add(new TransformRotation { StartValue = 10, EndValue = -10, StartTime = startTime + duration * 2, EndTime = startTime + duration * 4, Easing = EasingTypes.InOutSine, LoopCount = -1, LoopDelay = duration * 2 }); return(true); }
protected override void LoadComplete() { base.LoadComplete(); using (icon.BeginLoopedSequence()) icon.RotateTo(360, 1000); }
protected override void LoadComplete() { base.LoadComplete(); icon.RotateTo(360, 1000); icon.Loop(); }