Retromono.Tweens
1.0.1
dotnet add package Retromono.Tweens --version 1.0.1
NuGet\Install-Package Retromono.Tweens -Version 1.0.1
<PackageReference Include="Retromono.Tweens" Version="1.0.1" />
paket add Retromono.Tweens --version 1.0.1
#r "nuget: Retromono.Tweens, 1.0.1"
// Install Retromono.Tweens as a Cake Addin #addin nuget:?package=Retromono.Tweens&version=1.0.1 // Install Retromono.Tweens as a Cake Tool #tool nuget:?package=Retromono.Tweens&version=1.0.1
Retromono.Tweens
A minimal and extensible tweening library to use with C# - MonoGame, XNA, FNA, Unity and others.
Usage
Create an instance of any of the tween classes and call Advance()
passing the amount of time that has passed, like this:
public void constructor(){
_tween = new TweenAnimateDouble(TimeSpan.FromSeconds(5), 0, 10, value => x = value, () => Console.WriteLine("Finished!"));
}
public void Update(GameTime time){
_tween.Advance(time.ElapsedGameTime);
}
API
Commons
Each tween implements ITween
which has the following properties:
IsFinished
getter returns true when the tween is done, which might mean different things for different tweens.TimeSpan Advance(TimeSpan)
advances the tween by specified amount of time and returns how much of the time was used in the execution.void Finish()
instantly finishes the tween triggering all callbacks or events that were registered/passed to it.void Skip()
skips the execution of the tween marking it finished and not calling any callback or events.
Classes
Below is minimal documentation on all the available tween classes:
TweenSequence
Executes the added tweens in sequence, one by one. When a tween finishes without using up all of the time passed toAdvance()
, the remaining time is immediately used on the next tween in the queue. Instant tweens likTweenCallback
orTweenAwait
take 0 time and an infinite amount of them can run in the sameAdvance()
call.TweenParallel
Runs multiple tweens in parallel.TweenAnimateDouble
Tweensdouble
from a starting to final value with optional easing; takes an update callback as an argument that is called with the current value at least once per execution ofAdvance()
.TweenSleep
Waits for the specified amount of time doing nothingTweenAwait
Calls the passed function until it returns trueTweenCallback
Calls the passed function and immediately ends.
Class TweenAnimateBase
serves as basis for TweenAnimateDouble
and should you want to make another tween that does something similar all you have to
do is extend this base class.
Installation
This package is available in NuGet as retromono.tweens
.
NuGet CLI
- Make sure you have installed NuGet.
- Navigate to your project in CLI.
- Execute
nuget install retromono.tweens
VisualStudio (any version)
- In the top menu go to
Tools
→NuGet Package Manager
→Manage NuGet Packages for Solution
. The naming can be slightly different in different Visual Studio versions. - Change the tab to Browse.
- Type
retromono.tweens
in the Search field. - Select the package and in the project list on the right click the checkbox next to the projects you want to have this package, select version underneath and press Install.
JetBRains Rider
- In the top menu go to
Tools
→NuGet
→Manage NuGet Packages for Solution
. - Type
retromono.tweens
in the Search field. - Select the package and in the project list on the right select version and press the plus button next to the projects which you want to have the package installed.
License
This project is licensed under MIT license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 is compatible. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.6
- No dependencies.
-
.NETFramework 4.7.1
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Ducks