Retromono.Tweens 1.0.1

dotnet add package Retromono.Tweens --version 1.0.1
NuGet\Install-Package Retromono.Tweens -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Retromono.Tweens" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Retromono.Tweens --version 1.0.1
#r "nuget: Retromono.Tweens, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 to Advance(), the remaining time is immediately used on the next tween in the queue. Instant tweens lik TweenCallback or TweenAwait take 0 time and an infinite amount of them can run in the same Advance() call.
  • TweenParallel Runs multiple tweens in parallel.
  • TweenAnimateDouble Tweens double 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 of Advance().
  • TweenSleep Waits for the specified amount of time doing nothing
  • TweenAwait Calls the passed function until it returns true
  • TweenCallback 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

  1. Make sure you have installed NuGet.
  2. Navigate to your project in CLI.
  3. Execute nuget install retromono.tweens

VisualStudio (any version)

  1. In the top menu go to ToolsNuGet Package ManagerManage NuGet Packages for Solution. The naming can be slightly different in different Visual Studio versions.
  2. Change the tab to Browse.
  3. Type retromono.tweens in the Search field.
  4. 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

  1. In the top menu go to ToolsNuGetManage NuGet Packages for Solution.
  2. Type retromono.tweens in the Search field.
  3. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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.

Version Downloads Last updated
1.0.1 1,064 4/26/2018
1.0.0 920 3/16/2018

Ducks