| | |
| | | |
| | | function onSpriteMouseOver(event) { |
| | | if (tooltip) { |
| | | app.stage.removeChild(tooltip); |
| | | app?.stage.removeChild(tooltip); |
| | | } |
| | | tooltip = createSpriteTooltip(this);// this => sprite |
| | | tooltip.x = event.data.global.x + 10; |
| | |
| | | |
| | | function onSpriteMouseOut() { |
| | | if (tooltip && tooltip.parent) { |
| | | tooltip.parent.removeChild(tooltip); |
| | | tooltip.parent?.removeChild(tooltip); |
| | | tooltip = null; |
| | | } |
| | | } |
| | |
| | | effectTicker = null; |
| | | } |
| | | if (effectCircle) { |
| | | mapContainer.removeChild(effectCircle); |
| | | mapContainer?.removeChild(effectCircle); |
| | | effectCircle = null; |
| | | } |
| | | selectedSprite = null; |
| | |
| | | |
| | | // diff |
| | | let rotationDifference = targetRotation - currentRotation; |
| | | if (rotationDifference === 0) { |
| | | return; |
| | | } |
| | | rotationDifference = ((rotationDifference + Math.PI) % (2 * Math.PI)) - Math.PI; |
| | | |
| | | // destination |