完成后我必须禁用拖放活动。
我试过draggableContainer.enable = false;
没有运气。
如何在不将其从屏幕上移除的情况下禁用它?
draggableContainer.on('mousedown', function (e) {
//Hold on to the item being dragged
var thingBeingDragged = e.currentTarget;
var parent = thingBeingDragged.parent;
//Remove it from stage and readd it.
parent.removeChild(thingBeingDragged);
parent.addChild(thingBeingDragged);
thingBeingDragged.scaleX = 1.05;
thingBeingDragged.scaleY = 1.05;
var posX = e.stageX;
var posY = e.stageY;
startPositionX = e.stageX;
startPositionY = e.stageY;
this.offset = { x: this.x - posX, y: this.y - posY };
});
draggableContainer.enable = false;
答案 0 :(得分:0)
我对你的问题并不完全清楚,似乎你没有展示你的一些代码,因为没有拖放逻辑。
但是,您可以通过设置draggableContainer.mouseEnabled = false;