system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
PugMasterPug |
|
Old Version |
Published before Godot 3 was released. |
I have a Node2D, which contains a Panel, and I want to know when it is clicked.
do you want it on Node2D
node?
volzhs | 2018-01-06 00:12
do I want what on Node2D
node?
PugMasterPug | 2018-01-06 00:16
system
4
|
|
|
|
Reply From: |
eons |
Controls have a _gui_input
(_input_event
on 2.x) callback you can use to detect events on them, also as signal to pass to another node.
How do I do it so that it is called while it is pressed (not only the frame it is pressed, but all frames it is actually pressed)?
PugMasterPug | 2018-01-06 23:11
Events trigger only when happen, and “hold” is not an event, but you can use the “press” to enable processing in _process
like
func _process(delta):
if clicked:
do_something()
Turn that variable false on the release event.