Overwrite behavior of mouse_enter/exit in Control node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Christian
:warning: Old Version Published before Godot 3 was released.

http://docs.godotengine.org/en/stable/tutorials/2d/custom_gui_controls.html
This article explain about drawing, input and notification for custom controls. But how I overwrite what triggers the mouse_enter/exit notification?

I have a custom Control that is a hexagon and I need these notification (along with it’s signals and _functions) to trigger based in the hexagon shape instead of the default bounding box.

I had the same question back in the days, and in that time they answered “There’s no way”. I don’t think that changed. In my case I hard coded it in the script, checking mouse positions and comparing it to see if it was inside my shape or not.

CollisionObject2D has signals for that, and Area2D inherits it. Maybe you can use it.

mateusak | 2017-01-27 21:01