$InputDevice

$InputDevice.onメソッド

タッチパネル(マウス)上関連のイベントを受け取ります

書式

$InputDevice.on(type) \(e) {
    // 処理
};

例:

$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);
};

Backlink