I want to know how does InputEventGesture use?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DSperson

InputEventGesture only has one property position, I want to know how to get zoom in out direction and move direction at macOS

:bust_in_silhouette: Reply From: CollCaz

InputEventGesture is a base class, you will have to use one the classes that inherit from it for zooming and what not

here are links for the classes in the stable docs

Magnify Gesture
Pan Gesture

these don’t currently have descriptions so either check an older version of the docs or figure it out with experimentation. good luck!

edit:
try something like this?

if event is InputEventMagnifyGesture:
		camera.zoom = event.get_factor()

if event is InputEventPanGesture:
		camera.offset += event.get_delta()

btw i don’t have a touch screen or a laptop to test these.

CollCaz | 2023-05-06 15:49

Thank you very much!

DSperson | 2023-05-08 11:00

Im glad i could help!

CollCaz | 2023-05-10 17:01