Skip to main content

TweenService

Namespace: MonineEngine.Mathematics.Tweening

Manager class for Tween<T>s.

public class TweenService : MonineEngine.Core.IService, System.IDisposable

Inheritance ObjectTweenService
Implements IService, IDisposable
Attributes NullableContextAttribute, NullableAttribute

Properties

ActiveTweenCount

The current amount of active TweenService.Tween<T>(Object, TweenMember<T>, T, Single, Single, TweenEaseType, TweenMethod)s.

public int ActiveTweenCount { get; }

Property Value

Int32

Constructors

TweenService()

public TweenService()

Methods

Update(GameTime)

Updates Tween<T>s and manages internal values of the class.

public void Update(GameTime gameTime)

Parameters

gameTime GameTime
The time between now and the previous update cycle in seconds.

Tween<T>(Object, TweenMember<T>, T, Single, Single, TweenEaseType, TweenMethod)

Creates and returns a new Tween<T>.

public Tween<T> Tween<T>(object target, TweenMember<T> member, T endValue, float duration, float delay, TweenEaseType type, TweenMethod method)

Type Parameters

T
The type of the member to tween.
For example, if tweening a position, set this to Vector2. If tweening a color, set this to Color.

Parameters

target Object
The target object to be tweened.

member TweenMember<T>
The member within the target object being tweened.

endValue T
The value will be by the end of the Tween.

duration Single
The duration of the Tween in seconds.

delay Single
The delay between loops of the tween. Doesn't always apply. See Tween.Delay for more information. Defaults to 0.

type TweenEaseType
The type of easing to use during the Tween<T>. Defaults to TweenEaseType.Linear.

method TweenMethod
The method of execution to use with the Tween<T>. Defaults to TweenMethod.OneShot.

Returns

Tween<T>
The Tween<T> created.

CancelTweensOf(Object)

Cancel all active Tween<T>s associated with the given object.

public void CancelTweensOf(object target)

Parameters

target Object
The target object.

CancelAll()

Cancels all active Tween<T>s.

public void CancelAll()

Dispose()

public void Dispose()