Various zone editor UX improvements
This commit is contained in:
@ -64,6 +64,25 @@ watch(
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
// if ctrl is pressed and mouse is down , then drag the zone
|
||||
scene.input.on(Phaser.Input.Events.POINTER_DOWN, (pointer: Phaser.Input.Pointer) => {
|
||||
if (pointer.event.altKey) {
|
||||
scene.input.on(Phaser.Input.Events.POINTER_MOVE, dragZone)
|
||||
} else if (zoneEditorStore.tool !== 'move') {
|
||||
scene.input.off(Phaser.Input.Events.POINTER_MOVE, dragZone)
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Zoom in and out
|
||||
*/
|
||||
scene.input.on(Phaser.Input.Events.POINTER_WHEEL, (pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[], deltaX: number, deltaY: number) => {
|
||||
if (pointer.event.altKey) {
|
||||
scene.scale.setZoom(scene.scale.zoom - deltaY * 0.01)
|
||||
cam = scene.cameras.main
|
||||
}
|
||||
})
|
||||
|
||||
// Unload funcs
|
||||
onBeforeUnmount(() => {
|
||||
scene.input.off(Phaser.Input.Events.POINTER_MOVE, onPointerMove)
|
||||
|
Reference in New Issue
Block a user