더블 클릭 판단

4861 단어 판단
방법1: 이동도 더블 클릭으로 판단
onTouchesEnded:function(touches, event) {

        var touchOne =touches[0];
        var str = touchOne.getPreviousLocation().x + "
" + touchOne.getLocation().x; this._logLabel.setString(str); if (Math.abs(touchOne.getDelta().x) <=6 && Math.abs(touchOne.getDelta().y) <=6 ) { var bigger = cc.ScaleBy.create(3, 2); // var smaller = bigger.reverse(); // this._ship.runAction(cc.Sequence.create(bigger,smaller)); } },

 
방법2: 더블 클릭만 판정
onTouchesEnded:function(touches, event) {
        var touchOne =touches[0];

        var str = "" + "
" + this._lastTouchPos.x + "
" + this._lastTouchPos.y + "
" + "" + "
" + touchOne.getLocation().x + "
" + touchOne.getLocation().y + "
" this._posLabel.setString(str); // , , if (Math.abs(cc.pDistance(touchOne.getLocation(),this._lastTouchPos)) < 20) { this.onCaptainSkill(null); } else { this._lastTouchPos = touchOne.getLocation(); } }, onTouchesMoved:function (touches, event) { this._posLabel.setString(" "); this._lastTouchPos = cc.p(0,0); this.processEvent(touches[0]); },

좋은 웹페이지 즐겨찾기