• Godot HelpGUI
  • Is it possible to only filter out mouse button inputs on UI

Need some help creating drag and drop item system, like example in Path of Exile

Essentially if the item is on the world I can click on it (Button) that stop mouse events so that my player wouldn’t do any actions

My problem is that the item is a Button and in external node from the GUI

example:

World -> Item (Button)

GUI (Panel) -> Inventory (Gird) -> ItemSlot (Color Rect)

I click on item, button consumes an even and everything is fine, I can then move the item while dragging (still a Button) and want to put it in inventory, but the because the Button stop mouse event (even on pass, because it’s kinda outside the hierarchy ) the inventory doesn’t get any mouse events of entered or exited so I can’t determinate on which slot to put the item when I click on it again

I have it working with Area2D (pickable) when you pick up item it becomes from Button to Area2D as it doesn’t consumes event’s so the Inventory gets all the mouse entered or exited, but I can’t stop the player events let say when I want to drop the item to the world and the player should be still, because it impossible to accept Area2D Input Events

Is there a way to stop events while not in control hierarchy and pass mouse enter and exited, I know if the Item is in GUI → Inventory → ItemSlot → Item it will work fine because mouse passes upwards, but what about when the Item (Button) is outside of the hierarchy

  • xyz replied to this.

    zvonka Once you start dragging the item/button set its mouse filter mode to ignore. In this state it won't register or consume any mouse events.