| | |
| | | } |
| | | |
| | | mapSelect = (event) => { |
| | | if (this.selectedSprites && this.selectedSprites.length > 0) { |
| | | this.selectedSprites.forEach(child => { |
| | | Utils.unMarkSprite(child); |
| | | }) |
| | | } |
| | | this.selectedSprites = []; |
| | | let isSelecting = false; |
| | | |
| | | const selectionBox = new PIXI.Graphics(); |
| | |
| | | |
| | | this.app.view.addEventListener('mouseup', (event) => { |
| | | if (isSelecting) { |
| | | if (this.selectedSprites && this.selectedSprites.length > 0) { |
| | | this.selectedSprites.forEach(child => { |
| | | Utils.unMarkSprite(child); |
| | | }) |
| | | } |
| | | this.selectedSprites = []; |
| | | |
| | | this.mapContainer.children.forEach(child => { |
| | | if (Utils.isSpriteInSelectionBox(child, selectionBox)) { |
| | | this.selectedSprites.push(child); |