Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | nthrack | |
Old Version | Published before Godot 3 was released. |
Hello Everybody,
I’ve 2 instances of a control with a script that enlarges the control when the mouse is over.
But when i hover over the first control and than i click with left mouse button, if i hover on the second control, the event seems to be intercepted only by the first control.
This is the script:
extends Control
func _ready():
connect("mouse_enter",self,"mouse_enter")
connect("mouse_exit",self,"mouse_exit")
pass
func mouse_enter():
self.set_scale(Vector2(1.5,1.5))
func mouse_exit():
self.set_scale(Vector2(1,1))
I’ve tested adding a print when a controller catch events:
extends Control
func _ready():
connect("mouse_enter",self,"mouse_enter")
connect("mouse_exit",self,"mouse_exit")
pass
func mouse_enter():
self.set_scale(Vector2(1.5,1.5))
func mouse_exit():
self.set_scale(Vector2(1,1))
func _input_event(event):
print("movingOver:",get_name())
there is a way (using a control node) to archieve this ? :
Click on a Control1 - > move mouse over Control2 - > catch mouse_enter ( or another event) on Control2
Thanks in advance,
nthrack
I’ve made some tests :
the control capture Drag and Drop event when I keep pressed the left mouse button on it and no other events are passed to other controls .
I’ve changed the control with a Area2D and a collision shape and everything works correctly ,
Some one knows how to disable Drag and Drop on a Control or skip the event grab ?
TY
Same script on Area2D:
extends Area2D
func _ready():
connect("mouse_enter",self,"mouse_enter")
connect("mouse_exit",self,"mouse_exit")
pass
func mouse_enter():
self.set_scale(Vector2(1.5,1.5))
func mouse_exit():
self.set_scale(Vector2(1,1))
nthrack | 2016-06-30 07:26