| | |
| | | y: (event.global.y - batchMoveStartPos.y) / scale |
| | | }; |
| | | for (let sprite of selectedSprites) { |
| | | sprite.position.x = sprite.data.batchMoveStartPos.x + mouseMovement.x; |
| | | sprite.position.y = sprite.data.batchMoveStartPos.y + mouseMovement.y; |
| | | sprite.position.x = sprite.batchMoveStartPos.x + mouseMovement.x; |
| | | sprite.position.y = sprite.batchMoveStartPos.y + mouseMovement.y; |
| | | } |
| | | } |
| | | } |
| | |
| | | const batchMoveStart = (event) => { |
| | | batchMoveStartPos = { x: event.data.global.clone().x, y: event.data.global.clone().y }; |
| | | selectedSprites.forEach(child => { |
| | | child.data.batchMoveStartPos = { x: child.position.x, y: child.position.y }; |
| | | child.batchMoveStartPos = { x: child.position.x, y: child.position.y }; |
| | | }) |
| | | |
| | | batchMove = true; |