コード例 #1
0
        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;
            }
        }
コード例 #2
0
ファイル: TimingChangeCommand.cs プロジェクト: maxrchung/S2VX
        public override void Apply(double time, S2VXStory story)
        {
            var bpm = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.BPM    = bpm;
            story.Offset = StartTime;
        }
コード例 #3
0
ファイル: GameHoldNote.cs プロジェクト: maxrchung/S2VX
        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;
            }
        }
コード例 #4
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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        public override void Apply(double time, S2VXStory story)
        {
            var value = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.Approaches.HoldApproachColor = value;
        }
コード例 #13
0
        public override void Apply(double time, S2VXStory story)
        {
            var distance = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.Approaches.Distance = distance;
        }
コード例 #14
0
        public override void Apply(double time, S2VXStory story)
        {
            var color = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.Background.Colour = color;
        }
コード例 #15
0
        public override void Apply(double time, S2VXStory story)
        {
            var alpha = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.Grid.Alpha = alpha;
        }
コード例 #16
0
        public override void Apply(double time, S2VXStory story)
        {
            var thickness = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.Approaches.Thickness = thickness;
        }
コード例 #17
0
        public override void Apply(double time, S2VXStory story)
        {
            var value = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.Notes.NoteOutlineColor = value;
        }
コード例 #18
0
        public override void Apply(double time, S2VXStory story)
        {
            var showTime = S2VXUtils.ClampedInterpolation(time, StartValue, EndValue, StartTime, EndTime, Easing);

            story.Notes.ShowTime = showTime;
        }