| | |
| | | |
| | | // batch move |
| | | if (this.selectedSprites && this.selectedSprites.length > 0) { |
| | | this.batchMove = false; |
| | | let batchMove = false; |
| | | |
| | | const batchMoving = (event) => { |
| | | if (this.batchMove) { |
| | | if (batchMove) { |
| | | // offset move val |
| | | var mouseMovement = { |
| | | x: (event.global.x - this.batchMoveStartPos.x) / this.scale, |
| | |
| | | } |
| | | |
| | | const batchMoveEnd = (event) => { |
| | | batchMove = false; |
| | | this.selectedSprites.forEach(child => { |
| | | Utils.unMarkSprite(child); |
| | | }) |
| | |
| | | child.data.batchMoveStartPos = { x: child.position.x, y: child.position.y }; |
| | | }) |
| | | |
| | | this.batchMove = true; |
| | | batchMove = true; |
| | | this.mapContainer.parent.off('mousemove'); |
| | | this.mapContainer.parent.on('mousemove', batchMoving); |
| | | |