My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
tween  
an extremely lightweight tweening package
Featured
Updated Jun 20, 2010 by maxkugland@gmail.com

QTween is an extremely lightweight tweening package which satisfies my feature and performance needs completely even if it is not as fast or feature rich as other tweening libraries. The main goal behind QTween is the have typesafe concise and extendable API to tween the properties of any object. As IQTween extends IQable, any IQTween can be added to a queue

single property tween with easing (Sine.easeOut comes from robert penners easing equations) and delay:

	new QTween(new Sprite).add(QTweenConst.ALPHA, 1, 0).easing(Sine.easeOut).duration(200).delay(100).start();

multi property tween:

	new QTween(new Sprite).add(QTweenConst.ALPHA, 1, 0).add(QTweenConst.X, 100).duration(200).start();

special property tween:

	var s : Sprite = new Sprite;
	var prop : ISpecialProp = new ColorProp(s);
	new QTween(s).add(QTweenConst.ALPHA, 1, 0).add(ColorProp.COLOR, 0xff0000, NaN, prop).duration(200).start();

splinklibrary contains the ISpecialProperty implementations for FilterProp, ColorProp and ScrollRectProp

events:

	var t : IQTween = new QTween(new Sprite);
	t.register(QEvent.START, onStart);
	t.register(QEvent.COMPLETE, onComplete);
	t.register(QEvent.PROGRESS, onProgress);
	
	t.add(QTweenConst.ALPHA, 1, 0).add(QTweenConst.X, 100).duration(200);
	
	t.start();

If a property of an object is tweening and the same property of the same object is tweened while the first tween is still running, the second tween overrides the first. This mechanism handles competing tweens which often occur in rollover/rollout scenarios gracefully.


Sign in to add a comment
Powered by Google Project Hosting