Skip to content

A .Net (C#) implementation of the Javascript tweening engine

License

Notifications You must be signed in to change notification settings

lathoub/tween.cs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tween.cs

A .Net (C#) implementation of the Javascript tweening engine (https://github.com/tweenjs/tween.js)

Features

The features are identical to the Javascript tween engine. Also the code tried to be as close to the original as possible.

Usage

var position = new Hashtable { { "x", 0.0 } };

var tween = new Tween.Tween(position)
    .To(new Hashtable { { "x", 100.0 }}, 2000)
    .Easing(Easing.Bounce.InOut);

tween.Start();

tween.Updated += (o, args) =>
{
    var y = (double) args.Obj["x"];
    chart.Series["Series"].Points.AddXY(_time, y);
};

for (double i = 0; i < 2000; i = i + 10)
{
    _time = i;
    tween.Update(_time);
}

About

A .Net (C#) implementation of the Javascript tweening engine

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages