ユーザ用ツール

サイト用ツール


phinajs:button

タッチ操作で反応するボタン

SpriteやShapeのonpointstartやonpointendを設定することでタッチ操作に反応するボタンを作ることができます。 事前にsetInteractiveにtrueを指定しておく必要があります。

    this.button = RectangleShape({
        height: BUTTON_HEIGHT,
        width: BUTTON_WIDTH,
    });
    this.button.addChildTo(this.base);

    this.button.setInteractive(true);

    this.button.onpointstart = function() {
        // タッチ開始時の処理
    };

    this.button.onpointend = function() {
        // タッチ終了時の処理
    };
phinajs/button.txt · 最終更新: 2017/12/26 06:51 by kaneda