private void load() { direction.BindTo(scrollingInfo.Direction); timeRange.BindTo(scrollingInfo.TimeRange); direction.ValueChanged += _ => layoutCache.Invalidate(); timeRange.ValueChanged += _ => layoutCache.Invalidate(); }
private void onAccentChanged(ValueChangedEvent <Color4> accent) { foreground.Colour = HitColour.Value; background.Colour = display.Value ? accent.NewValue : new Color4(23, 41, 46, 255); subtractionCache.Invalidate(); }
private void computeScreenSpaceCharacters() { if (!parentScreenSpaceCache.IsValid) { localScreenSpaceCache.Invalidate(); parentScreenSpaceCache.Validate(); } if (localScreenSpaceCache.IsValid) { return; } screenSpaceCharactersBacking.Clear(); Vector2 inflationAmount = DrawInfo.MatrixInverse.ExtractScale().Xy; foreach (var character in Characters) { screenSpaceCharactersBacking.Add(new ScreenSpaceCharacterPart { DrawQuad = ToScreenSpace(character.DrawRectangle.Inflate(inflationAmount)), InflationPercentage = Vector2.Divide(inflationAmount, character.DrawRectangle.Size), Texture = character.Texture }); } localScreenSpaceCache.Validate(); }
private void updateSpacing() { DistanceSpacing = SnapProvider.GetBeatSnapDistanceAt(StartTime); if (endTime == null) { MaxIntervals = int.MaxValue; } else { // +1 is added since a snapped hitobject may have its start time slightly less than the snapped time due to floating point errors double maxDuration = endTime.Value - StartTime + 1; MaxIntervals = (int)(maxDuration / SnapProvider.DistanceToDuration(StartTime, DistanceSpacing)); } gridCache.Invalidate(); }
private void updateSpacing() { float distanceSpacingMultiplier = (float)DistanceSpacingMultiplier.Value; float beatSnapDistance = SnapProvider.GetBeatSnapDistanceAt(ReferenceObject); DistanceBetweenTicks = beatSnapDistance * distanceSpacingMultiplier; if (LatestEndTime == null) { MaxIntervals = int.MaxValue; } else { MaxIntervals = (int)((LatestEndTime.Value - StartTime) / SnapProvider.DistanceToDuration(ReferenceObject, beatSnapDistance)); } gridCache.Invalidate(); }
private void onAccentChanged(ValueChangedEvent <Colour4> accent) { foregroundBuffer.Colour = accent.NewValue.Opacity(0.5f); const float animation_length = 50; foregroundBuffer.ClearTransforms(false, nameof(foregroundBuffer.Colour)); if (IsHitting.Value) { // wait for the next sync point double synchronisedOffset = animation_length * 2 - Time.Current % (animation_length * 2); using (foregroundBuffer.BeginDelayedSequence(synchronisedOffset)) foregroundBuffer.FadeColour(accent.NewValue.Lighten(0.2f), animation_length).Then().FadeColour(foregroundBuffer.Colour, animation_length).Loop(); } subtractionCache.Invalidate(); }
private void onAccentChanged(ValueChangedEvent <Color4> accent) { Foreground.Colour = HitColour.Value; Background.Colour = display.Value ? AccentColour.Value : new Color4(23, 41, 46, 255); Foreground.ClearTransforms(false, nameof(Foreground.Colour)); Foreground.Alpha = 0; if (isHitting.Value) { Foreground.Alpha = 1; const float animation_length = 50; // wait for the next sync point double synchronisedOffset = animation_length * 2 - Time.Current % (animation_length * 2); using (Foreground.BeginDelayedSequence(synchronisedOffset)) Foreground.FadeColour(accent.NewValue.Lighten(0.7f), animation_length).Then().FadeColour(Foreground.Colour, animation_length).Loop(); } subtractionCache.Invalidate(); }
protected virtual void OnDirectionChanged(ValueChangedEvent <ScrollingDirection> e) { scrollingDirection = (KaraokeScrollingDirection)e.NewValue; flashlightProperties.Invalidate(); }