NAME enchant.dab.iris - Iris-in, Iris-out effect VERSION version 1.3.1 DESCRIPTION アイリスイン、アイリスアウトのイフェクト用プラグイン Constructor new Iris(width, height, fps): width、heightはアイリスを囲む矩形のサイズ。 fpsは1またはゲームのFPS。1を指定すると、以降のメソッドの引数に指定するtimeはフレーム数として扱われる。 引数は省略可能。省略した場合は、ゲームコアのオプションを使用する。 Methods setCenter(x, y): アイリスの中心位置を指定。 setRadius(r): アニメーションを止める半径。 setTime(time, easing): 時間とイージング。 fillColor(r, g, b, a): アイリスの色と透過度を指定。0 <= r, g, b <=255、0 <= a <= 1.0。 setColor(r, g, b, a): fillColorのラッパー。 restart(): アニメーションのリスタート、またはリジューム。 resetCircle(): アイリスの大きさをリセットする。 Properties inout (String): "in" : アイリスイン、"out": アイリスアウト。 toRemove (Boolean): アニメーション終了後、オブジェクトをシーンから取り除く。 irisWait (Boolean): アニメーションを停止、待機する。 width (Number): アイリスを囲む矩形の幅。 height (Number): アイリスを囲む矩形の高さ。 touchEnabled (Boolean): touchstart、touchmove、touchendイベント通知設定。 EVENT Type "irisend": アイリスアニメーション終了後のイベントタイプ Coding Sample // export 'dab' to use "new Iris()". // also you can use "use enchant()" and "new enchant.dab.Iris()" enchant('dab'); window.onload=function(){ var game = new Game(320, 320); game.fps=30; game.onload=function(){ // create instance of Iris var iris=new Iris(game.width, game.height, game.fps); // the effect will be set "iris-in" iris.inout="in"; // sprite will be removed after finished the animation. iris.toRemove=true; // set the duration at 3 seconds and easing iris.setTime(3, enchant.Easing.SIN_EASEIN); // add EVENT Listener to call function after iris animation finished. iris.addEventListener("irisend", function(e){ alert('iris finished'); }); game.rootScene.addChild(iris); }; game.start(); }