Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Juicy-Fruit | |
Old Version | Published before Godot 3 was released. |
I have connected StreamPlayer-> TextureButton
How to make a button that stops when you release the music play
my code
`extends TextureButton
func _ready():
pass
func _on_TextureButton_pressed():
get_tree().get_root().get_node(“StreamPlayer”).play()
pass
func _on_TextureButton_released():
get_tree().get_root().get_node(“StreamPlayer”).stop()
pass
func _on_TextureButton_toggled( pressed ):
pass
`
but why this code does not work
Sorry for my English
Если нужно сделать кнопку которая перестает работать после отпускания нужно добавить в ИНСПЕКТОРЕ Click On Press и в коде добавлять не чего не надо
Juicy-Fruit | 2016-09-17 12:24