insideout-andrew / simple-card-pile-ui

This plugin provides a flexible and customizable card pile user interface for the Godot game engine. It is designed to handle various card-related functionalities including drawing, discarding, and managing different piles.
MIT License
84 stars 9 forks source link

Why choose Control as base class? #1

Open nocturne123 opened 3 months ago

nocturne123 commented 3 months ago

Why choose Control as base class? Why not node or sprite2d? Sorry for disturbing, I want to know the inside logic, But I don't know where to communicate.

insideout-andrew commented 3 months ago

I had a prototype of this using Node2D but the mouse interaction events were much easier to use with Controls. For example, if you are using Area2D and multiple areas overlap, they all trigger mouse hover events. Instead of doing workarounds, I just switch to using control. You can see what I mean here: https://www.reddit.com/r/godot/comments/19e8n0x/how_to_manage_mouse_movement_on_overlapping/