您的位置:首页 > Web前端 > JavaScript

Create.js拖拽事件处理机制

2017-07-10 14:46 375 查看
直接上代码 ,怕自己忘记

sheetContainer.on("mousedown", function (evt) {
this.parent.addChild(this);
this.offset = {x: this.x - evt.stageX, y: this.y - evt.stageY};
});
sheetContainer.on("pressmove", function (evt) {
this.x = evt.stageX + this.offset.x;
this.y = evt.stageY + this.offset.y;
// indicate that the stage should be updated on the next tick:
update = true;
});

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  CreateJS