I am currently trying to add new features to Escoria Framework (https://github.com/godotengine/escoria), which is a Libre framework for the creation of point-and-click adventure games in Godot Engine.
The current classic design of a scene is this one :
Node2D (script: scene.gd)
|- TextureFrame (script background.gd)
|- linked game.scn node (script: game.gd)
|- TextureButton (script: item.gd)
|- TextureButton2 (script: item.gd)
|- linked player scene (script: player.gd)
|- Navigation (script: terrain.gd)
My problem lies between the TextureFrame and the items' TextureButtons.
The background node (TextureFrame) catches all inputs from the user (mouse clicks) and calls specific methods from the game node (game.gd) that manages clicks, thus making the player move in the scene.
Concerning mouse pointer hovering an item, this event is managed directly by TextureButtons, which extend Control. The mask defining the "hover zone" is either the whole TextureButton (rectangle), or a mask image parameter.
I want to be able to define an Area2D node (extends CollisionObject2D, thus manages mouseenter/mouseexit events) with a CollisionPolygon2D child, allowing the user to define "hover zones" directly in the editor, instead of having to create and/or modify a mask image for this purpose.
The problem is that the background node (TextureFrame) avoids my Area2D node to catch mouse_enter event, since it catches all mouse events before.
You can have an illustration with the demo at this URL: https://github.com/StraToN/escoria-test .
1/ Load the res://scenes/rooms/desk/scene.scn and run it.
2/ Try to hover the shelf (Area2D) on the left : nothing happens.
3/ Try to hover the ice cream on the right (TextureButton) : the item name appears.
4/ In the editor, select the background node and check "Ignore Mouse". Re-run.
5/ Hover both items : it works, since mouse is disabled in background node, Area2D can catch it.
6/ Try to click anywhere on the terrain: the player doesn't move, which is normal since mouse is ignored.
Thanks for any hints :) !