![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Klagsam |
I am making a card game in which the player should play cards onto certain landtiles via drag an drop.
For this 3 things have to work:
a) The player should be able to move the mouse cursor above the cards in the card hand. Each card under the mouse cursor should the be moved a bit up and zoomed a bit. → for this to work I am using a ToolButton a the card. I tried Area2D with Collision2D, but because of the overlapping cards I am not getting valid mouse_entered and mouse_exited signals.
b) An indicator line should appear after the player clicked on a card and disappear after he relseases the mouse.
c) While the mouse button is down the landtiles a player can play the card onto should be highlighted and they should accept the card if possible.
a) and b) work just fine. c) however I am stuck with.
I tried to implement get_drag_data()
onto the card node. That would work, but then my mouse cursor changes as long as I am on the card into a “forbidden sign”. And whats more important: my indicator line does not disappear after releasing the mouse button.
So basically I am looking for a solution how to keep tracking the mouse after i clicked onto my Card (i.e. ToolButton). I also tried to set mouse_filter to PASS, but that didn’t work either. Any other ideas?
I did also insert a screeshot to clarify, but it does not show. url: [1]: Imgur: The magic of the Internet
Klagsam | 2019-11-12 07:52