$InputDevice.on - hoge1e3/Tonyu2 GitHub Wiki
$InputDevice.onメソッド
タッチパネル(マウス)上関連のイベントを受け取ります
書式
$InputDevice.on(type) \(e) {
// 処理
};
typeには"touchstart"、"touchmove"、"touchend"のいずれかを指定します。eにはイベントオブジェクトが渡されます。e.fingerに タッチした・移動した・離れた指のTouchFingerオブジェクトが格納されます。
例: Main
$Boot.setEconomyMode(true);
x=100;
y=100;
$InputDevice.on("touchstart") \(e) {
var f=e.finger;
print("start",f.x,f.y);
};
$InputDevice.on("touchmove") \(e) {
var f=e.finger;
//print("move",f.x,f.y);
f.update();
x+=f.vx;
y+=f.vy;
};
$InputDevice.on("touchend") \(e) {
var f=e.finger;
print("end",f.x,f.y);
};