/**
* Copyright shohei909 ( http://wonderfl.net/user/shohei909 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ucqA
*/
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Point;
import org.libspark.ukiuki.Ukiuki;
import org.libspark.ukiuki.ease.Back;
[SWF(frameRate="60",width="465",height="465")]
public class UkiukiTest extends Sprite
{
private var mouse:Point = new Point( 0, 0 );
public function UkiukiTest()
{
var t:Text;
t = new Text("tween");
t.x = 50; t.y = 100;
Ukiuki.tween( addChild(t), { x:415 }, { repeat: -1, ease:Back.IN_OUT, time:120 } );
t = new Text("yoyo");
t.x = 50; t.y = 200;
Ukiuki.yoyo( addChild(t), { x:415 }, { repeat: -1, ease:Back.OUT, time:60, intervals:[0,50] } );
t = new Text("zigzag");
t.x = 233; t.y = 300;
Ukiuki.zigzag( addChild(t), { x:180 }, { repeat: -1, ease:Back.OUT, time:30, intervals:[50,0] } );
t = new Text("random");
t.x = 223; t.y = 223;
Ukiuki.random( addChild(t), { x:220, y:220 }, { useTween:true, ease:Back.OUT, time:45, intervals:[0,100] } );
t = new Text("accel");
t.x = 100; t.y = 223;
Ukiuki.accel( addChild(t), { x:3, y:3 }, { outType:"bound" }, { x:50, y:20 }, { x:415, y:445 } );
t = new Text("chase");
t.x = 223; t.y = 223;
Ukiuki.chase2D( addChild(t), mouse, { outType:"bound", spring:0.1, inertia:0.95 }, { x:50, y:20 }, { x:415, y:445 } );
t = new Text("sequence");
t.x = 100; t.y = 100;
Ukiuki.sequence( addChild(t), [ /*["param","value","time"],*/ ["x", 365, 45], ["y", 365, 45], ["x", 100, 45], ["y", 100, 45], ["G", 0] ] );
//addEventListener( "enterFrame", onFrame );
Ukiuki.sequence( null, [ [onFrame, [null], 1], ["L"] ] );
}
private function onFrame( e:Event ):void {
mouse.x = mouseX;
mouse.y = mouseY;
}
}
}
import flash.text.TextField;
import flash.display.Sprite;
class Text extends Sprite{
function Text(str:String) {
var t:TextField = new TextField();
t.text = str;
t.scaleX = t.scaleY = 3.5;
t.autoSize = "center"
t.alpha = 0.8;
t.selectable = false;
addChild(t);
t.x = -t.width / 2;
t.y = -t.height / 2;
}
}