18.9% faster than the Tweener
The benchmark tweens 2,000 objects in six seconds. I run it three times for each tween engines to take the average frame-rate below.I run this on the standalone Flash Player 10.0.22.87, Core 2 Duo 2.26 GHz, MacBook Pro Unibody. The screen capture is:
Larger number of fps means faster. Source code of this is here.
Engine | FPS |
---|---|
KTween | 27.19 fps |
BetweenAS3 | 26.77 fps |
TweenNano | 26.70 fps |
GTween | 26.38 fps |
Tweener | 22.87 fps |
Note that the KTween engine is one of the most reasonable alternative for the time-honored engine of the Tweener especially for the applications targeting a mobile device which is not allowed to run Adobe's Flash Player, as needing AS3's type declaration will soon come the must thing in case of compiling the .swf (ABC) to the native binary (ex. armv6/7).
SYNOPSIS
import net.kawa.tween.KTween;The syntax looks like the TweenMax series. This means the users could easily transfer to the new engine.
import net.kawa.tween.easing.*;
public function run():void {
KTween.to(mySprite, 2, {alpha: 0.0}, Linear.easeOut, callback);
KTween.from(mySprite, 3, {x:320, y;480}, Quad.easeOut).round = true;
}
FEATURES
- Free under the MIT license. Original. written from scratch.
- ActionScript 3.0. Flash 9/10 and later.
- Simple. Shorter source code. Less file bytes.
- Much faster than Tweener and GTween. Bit faster than TweenNano and BetweenAS3.
- AS3 type declaration checking available for the options of KTween
See more detail on Google Code.
TODO
- .swc distribution in addition to .as source files.
- get the adoption on the Wonderfl!
Comments for this is fully welcome. Thanks in advance. Enjoy!
The original post of this is written in Japanese.(日本語ポストはこちら)