Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphNode mouse-filter options #2314

Open
sschellhoff opened this issue Mar 29, 2019 · 0 comments
Open

GraphNode mouse-filter options #2314

sschellhoff opened this issue Mar 29, 2019 · 0 comments
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@sschellhoff
Copy link

GraphNode seems to need the mouse-filter set to pass to work. If you try to set the mouse_filter (on GraphNode's _ready function or via the inspector), the mouse-filter gets reset. A workaround is to set the filter in the GraphNode's _gui_input event. But if you set the mouse-filter to STOP, you cannot drag and drop the GraphNode.
So it should be clear that you should not edit the mouse-filter and it should be clear why you shouldn't. Maybe with an example, how you can just filter some events. In my case, i just needed to filter the right-mouse-click events out, so i wrote this code in GraphNode:

func _on_GraphNode_gui_input(event):
	if event is InputEventMouseButton and event.button_index == BUTTON_RIGHT and event.pressed:
		self.mouse_filter = Control.MOUSE_FILTER_STOP
	else:
		self.mouse_filter = Control.MOUSE_FILTER_PASS
@NathanLovato NathanLovato added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

No branches or pull requests

3 participants