-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a check if mouse is in control method #3956
Comments
Related to godotengine/godot#40012 ? |
var rect = control.get_global_rect()
var mouse_position = control.get_global_mouse_position()
if rect.has_point(mouse_position):
print("mouse is inside control")
else:
print("mouse is NOT inside control") |
This work in a lot of case but can be not enough because a position can be in the control but blocked by another control. |
For |
Describe the project you are working on
slay the spire like card game
Describe the problem or limitation you are having in your project
when moving a control node and the mouse is stationary and the control moves under the mouse it doesnt send mouse_entered/exited signals
this also is the case with area2d nodes
Describe the feature / enhancement and how it helps to overcome the problem or limitation
a function that checks if the mouse is inside the control then i can just call this function manualy after the control move is over
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
a is_mouse_inside function inside the control node maybe ? or a better name
If this enhancement will not be used often, can it be worked around with a few lines of script?
you would need to get the controlrect ,transorm and the mouseposition and find a way to manually check the collision
Is there a reason why this should be core and not an add-on in the asset library?
since the control has a the mouse_exited/entered signals i think that such a function would already exist in the control node but isnt exposed yet
The text was updated successfully, but these errors were encountered: