Advertisement
otorp2

timer_print_label

Dec 17th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. *control node then label node as child*
  2. extends Control
  3.  
  4. var timer
  5. export var wait_time = 3
  6. var label
  7.  
  8. func _ready():
  9. set_process(true)
  10. timer = Timer.new()
  11. add_child(timer)
  12. timer.set_wait_time(wait_time)
  13. timer.set_one_shot(true)
  14. timer.connect('timeout',self,"pt")
  15. timer.start()
  16. label = get_node("Label")
  17. pass
  18.  
  19. func _process(delta):
  20. label.set_text(str(timer.get_time_left()))
  21.  
  22. func pt():
  23. print("over")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement