| | |
| | | }, 200).start(); |
| | | } |
| | | |
| | | rotateMap = () => { |
| | | const bounds = this.mapContainer.getLocalBounds(); |
| | | const centerX = bounds.x + bounds.width / 2; |
| | | const centerY = bounds.y + bounds.height / 2; |
| | | this.mapContainer.pivot.set(centerX, centerY); |
| | | this.mapContainer.position.set(this.app.renderer.width / 2, this.app.renderer.height / 2); |
| | | |
| | | const rotationIncrement = Math.PI / 2; // 90 degrees in radians |
| | | const newRotation = this.mapContainer.rotation + rotationIncrement; |
| | | |
| | | new TWEEDLE.Tween(this.mapContainer) |
| | | .to({ rotation: newRotation }, 300) |
| | | .easing(TWEEDLE.Easing.Quadratic.Out) |
| | | .start(); |
| | | } |
| | | |
| | | showCoordinates = () => { |
| | | this.coordinatesText = new PIXI.Text('{ x: 0, y: 0 }', { |
| | | fill: this.themeMode === 'dark' ? 0xdddddd : 0x333333, |