![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | System_Error |
Hi all.
In a game I’m putting together, I’d like to make some custom buttons. I think TextureButton is the right node, but I don’t know how to use it for buttons with a single, custom texture. The code below is for the GUI, aptly called HUD.gd.
extends CanvasLayer
signal play_game
func show_message(text):
$SystemMessage.text = text
$SystemMessage.show()
$MessageDuration.start()
func player_loss():
show_message("Game Over")
yield($MessageDuration, "timeout")
$Button.show()
$SystemMessage.text = "New Game?"
$SystemMessage.show()
func score_count(score):
$TimeSurvived.text = str(score)
func _on_MessageDuration_timeout():
$SystemMessage.hide()
func _on_Button_pressed():
$Button.hide()
emit_signal('play_game')
I’d like to be able to make my own buttons, and know where they’d go in my current project.
I know how to use the signals, so I can connect those to what they’re going to move. Just working out how to best have the buttons…
System_Error | 2018-12-15 22:43