protected override void UpdateColor() { var time = Time.Current; var notes = Story.Notes; var maxAlpha = notes.NoteAlpha; InnerColor = notes.NoteColor; OutlineColor = notes.NoteOutlineColor; OutlineThickness = notes.NoteOutlineThickness; // Fade in time to Show time if (time < HitTime - notes.ShowTime) { var startTime = HitTime - notes.ShowTime - notes.FadeInTime; var endTime = HitTime - notes.ShowTime; Alpha = S2VXUtils.ClampedInterpolation(time, 0.0f, maxAlpha, startTime, endTime); } // Show time to Hit time with miss threshold time // Hold the note at fully visible until after MissThreshold else if (time < HitTime + Notes.HitThreshold) { Alpha = maxAlpha; } // Hit time with miss threshold time to Fade out time else if (time < HitTime + Notes.HitThreshold + notes.FadeOutTime) { var startTime = HitTime + Notes.HitThreshold; var endTime = HitTime + Notes.HitThreshold + notes.FadeOutTime; Alpha = S2VXUtils.ClampedInterpolation(time, maxAlpha, 0.0f, startTime, endTime); } else { Alpha = 0; } }
public override void Apply(double time, S2VXStory story) { var bpm = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.BPM = bpm; story.Offset = StartTime; }
protected override void UpdateColor() { var time = Time.Current; var notes = Story.Notes; var maxAlpha = notes.HoldNoteAlpha; InnerColor = notes.HoldNoteColor; OutlineColor = notes.HoldNoteOutlineColor; OutlineThickness = notes.HoldNoteOutlineThickness; // Fade in time to Show time if (time < HitTime - notes.ShowTime) { var startTime = HitTime - notes.ShowTime - notes.FadeInTime; var endTime = HitTime - notes.ShowTime; Alpha = S2VXUtils.ClampedInterpolation(time, 0.0f, maxAlpha, startTime, endTime); } // Show time to End time else if (time < EndTime) { Alpha = maxAlpha; } // End time to Fade out time else if (time < EndTime + notes.FadeOutTime) { var startTime = EndTime; var endTime = EndTime + notes.FadeOutTime; Alpha = S2VXUtils.ClampedInterpolation(time, maxAlpha, 0.0f, startTime, endTime); } else { Alpha = 0; } }
public override void Apply(double time, S2VXStory story) { var scale = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Camera.TakeCameraScaleLock(this); story.Camera.SetScale(this, scale); story.Camera.ReleaseCameraScaleLock(this); }
public override void Apply(double time, S2VXStory story) { var position = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Camera.TakeCameraPositionLock(this); story.Camera.SetPosition(this, position); story.Camera.ReleaseCameraPositionLock(this); }
public void ValueAt_Double_0DurationUsesStartValue() { var inputCurrentTime = 1.0f; var inputStartValue = 0.1f; var inputEndValue = 1.0f; var inputStartTime = 1.0f; var inputEndTime = 1.0f; var inputEasing = Easing.None; var expected = inputStartValue; var actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual, FloatingPointTolerance); }
public void ValueAt_Color_0DurationUsesStartValue() { var inputCurrentTime = 1.0f; var inputStartValue = Color4.White; var inputEndValue = Color4.Black; var inputStartTime = 1.0f; var inputEndTime = 1.0f; var inputEasing = Easing.None; var expected = inputStartValue; var actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); }
public void ValueAt_Vector2_0DurationUsesStartValue() { var inputCurrentTime = 1.0f; var inputStartValue = Vector2.Zero; var inputEndValue = Vector2.One; var inputStartTime = 1.0f; var inputEndTime = 1.0f; var inputEasing = Easing.None; var expected = inputStartValue; var actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); }
public void ValueAt_Double_Non0Duration() { // Startpoint var inputCurrentTime = 0.0f; var inputStartValue = 0.0f; var inputEndValue = 1.0f; var inputStartTime = 0.0f; var inputEndTime = 1.0f; var inputEasing = Easing.None; var expected = inputStartValue; var actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual, FloatingPointTolerance); // Midpoint inputCurrentTime = 0.5f; expected = 0.5f; actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual, FloatingPointTolerance); // Endpoint inputCurrentTime = 1.0f; expected = inputEndValue; actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual, FloatingPointTolerance); }
public void ValueAt_Vector2_Non0Duration() { // Startpoint var inputCurrentTime = 0.0f; var inputStartValue = Vector2.Zero; var inputEndValue = Vector2.One; var inputStartTime = 0.0f; var inputEndTime = 1.0f; var inputEasing = Easing.None; var expected = inputStartValue; var actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); // Midpoint inputCurrentTime = 0.5f; expected = Vector2.Divide(inputEndValue, 2); actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); // Endpoint inputCurrentTime = 1.0f; expected = inputEndValue; actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); }
public void ValueAt_Color_Non0Duration() { // Startpoint var inputCurrentTime = 0.0f; var inputStartValue = Color4.White; var inputEndValue = Color4.Black; var inputStartTime = 0.0f; var inputEndTime = 1.0f; var inputEasing = Easing.None; var expected = inputStartValue; var actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); // Midpoint inputCurrentTime = 0.5f; expected = new Color4(0.5f, 0.5f, 0.5f, 1); actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); // Endpoint inputCurrentTime = 1.0f; expected = inputEndValue; actual = S2VXUtils.ClampedInterpolation(inputCurrentTime, inputStartValue, inputEndValue, inputStartTime, inputEndTime, inputEasing); Assert.AreEqual(expected, actual); }
public override void Apply(double time, S2VXStory story) { var value = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Approaches.HoldApproachColor = value; }
public override void Apply(double time, S2VXStory story) { var distance = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Approaches.Distance = distance; }
public override void Apply(double time, S2VXStory story) { var color = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Background.Colour = color; }
public override void Apply(double time, S2VXStory story) { var alpha = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Grid.Alpha = alpha; }
public override void Apply(double time, S2VXStory story) { var thickness = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Approaches.Thickness = thickness; }
public override void Apply(double time, S2VXStory story) { var value = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Notes.NoteOutlineColor = value; }
public override void Apply(double time, S2VXStory story) { var showTime = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing); story.Notes.ShowTime = showTime; }