Hi,
Detecting if a mouse has clicked ON a control is easy. However, I'm having trouble detecting if a mouse entering a control is already clicked.
What I'm trying to do is a row of buttons, but you only need to click one of them, then drag the mouse and any "neighbor" buttons will toggle to match the first clicked button, a little bit like Photoshop's layer visibility buttons.
But the obvious "store the mouse click in variable, then check for mouse entering" is not working, i.e.:
func _ready():
set_process_input(true)
func _input(event):
if event is InputEventMouseButton:
if event.is_pressed():
mouse_pressed = true
else:
mouse_pressed = false
func _on_mouse_entered():
if mouse_pressed:
print("button is drag-pressed!")
Any suggestions? Thanks!