Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

cocos2d-js鼠标移动bugBUG

$
0
0

@a6965921 写道:

if ('mouse' in cc.sys.capabilities)
cc.eventManager.addListener({
event: cc.EventListener.MOUSE,
onMouseMove: function (event) {

        if (event.getButton() == cc.EventMouse.BUTTON_LEFT)
            console.log(event.getLocation());
          var ssss = new cc.Sprite(res.HelloWorld_png);
             ssss.attr({
            x: event.getLocation().x,
            y: event.getLocation().y
        });
        that.addChild(ssss, 0);
        }
}, this);

这个鼠标我没按左键 也照样能画精灵。。

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>