Federico-Ciuffardi / GodotTouchInputManager

Asset that improves touch input support (includes new gestures) in the Godot game engine. It also translates mouse input to touch input.
MIT License
525 stars 35 forks source link

Godot 4 Support #22

Closed dave2 closed 1 year ago

dave2 commented 2 years ago

I'm playing around with the current alpha of Godot 4 (4.0-alpha14), and there's quite a few changes which need to be made for at least importing properly.

I can provide a patch but it would probably need a new major version or branch because the changes are not backwards compatible.

dave2 commented 2 years ago

Added initial changes to this branch on my fork: https://github.com/dave2/GodotTouchInputManager/tree/godot-4.0-support

Federico-Ciuffardi commented 2 years ago

Hello David, thank you for your interest in the project!

I created a new godot4support branch, feel free to make a PR when you're done.

OmarShehata commented 1 year ago

Hey @Federico-Ciuffardi , the godot4support branch seems to be exactly inline with master, and doesn't contain Dave's changes above. But I opened a PR branched off of Dave's changes & targeting the godot4support branch: https://github.com/Federico-Ciuffardi/GodotTouchInputManager/pull/28

OmarShehata commented 1 year ago

It just occurred to me that one reason it would be nice if/when we can get it merged directly into the engine instead of these being custom events on the GDScript side is that: events triggered through Input.parse_input_event(val) won't process collision queries. Like if I have an Area2D that's pickable, the custom event doesn't reach there:

$Area2D.input_pickable = true
$Area2D.connect("input_event", 
func (_viewport, event, _shape_idx):
  if event is InputEventSingleScreenTap:
    print(event)
)

I don't know if there's a way to fix that, might just need to be a caveat we document

Federico-Ciuffardi commented 1 year ago

There is an issue about this (#16), at the moment the solution is to manually check for collisions between shapes and events, maybe we should add a FAQ section in the README and include this there. If you want to try it, feel free to do a PR.

Federico-Ciuffardi commented 1 year ago

Godot 4 is supported after the merge of PR #28!