public FlatRedBall.Glue.StateInterpolation.Tweener InterpolateToRelative(VariableState toState, double secondsToTake, FlatRedBall.Glue.StateInterpolation.InterpolationType interpolationType, FlatRedBall.Glue.StateInterpolation.Easing easing, object owner = null) { Gum.DataTypes.Variables.StateSave current = GetCurrentValuesOnState(toState); Gum.DataTypes.Variables.StateSave toAsStateSave = AddToCurrentValuesWithState(toState); FlatRedBall.Glue.StateInterpolation.Tweener tweener = new FlatRedBall.Glue.StateInterpolation.Tweener(from: 0, to: 1, duration: (float)secondsToTake, type: interpolationType, easing: easing); if (owner == null) { tweener.Owner = this; } else { tweener.Owner = owner; } tweener.PositionChanged = newPosition => this.InterpolateBetween(current, toAsStateSave, newPosition); tweener.Ended += () => this.CurrentVariableState = toState; tweener.Start(); StateInterpolationPlugin.TweenerManager.Self.Add(tweener); return(tweener); }
public FlatRedBall.Glue.StateInterpolation.Tweener InterpolateTo(ComboBoxCategory toState, double secondsToTake, FlatRedBall.Glue.StateInterpolation.InterpolationType interpolationType, FlatRedBall.Glue.StateInterpolation.Easing easing, object owner = null) { Gum.DataTypes.Variables.StateSave current = GetCurrentValuesOnState(toState); Gum.DataTypes.Variables.StateSave toAsStateSave = this.ElementSave.Categories.First(item => item.Name == "ComboBoxCategory").States.First(item => item.Name == toState.ToString()); FlatRedBall.Glue.StateInterpolation.Tweener tweener = new FlatRedBall.Glue.StateInterpolation.Tweener(from: 0, to: 1, duration: (float)secondsToTake, type: interpolationType, easing: easing); if (owner == null) { tweener.Owner = this; } else { tweener.Owner = owner; } tweener.PositionChanged = newPosition => this.InterpolateBetween(current, toAsStateSave, newPosition); tweener.Ended += () => this.CurrentComboBoxCategoryState = toState; tweener.Start(); StateInterpolationPlugin.TweenerManager.Self.Add(tweener); return(tweener); }
public FlatRedBall.Glue.StateInterpolation.Tweener InterpolateTo(Gum.DataTypes.Variables.StateSave first, Gum.DataTypes.Variables.StateSave second, double secondsToTake, FlatRedBall.Glue.StateInterpolation.InterpolationType interpolationType, FlatRedBall.Glue.StateInterpolation.Easing easing) { FlatRedBall.Glue.StateInterpolation.Tweener tweener = new FlatRedBall.Glue.StateInterpolation.Tweener(from: 0, to: 1, duration: (float)secondsToTake, type: interpolationType, easing: easing); tweener.Owner = this; tweener.PositionChanged = newPosition => this.InterpolateBetween(first, second, newPosition); tweener.Start(); StateInterpolationPlugin.TweenerManager.Self.Add(tweener); return tweener; }