Reddit Reddit reviews GD Script: Godot 3.1 game engine

We found 1 Reddit comments about GD Script: Godot 3.1 game engine. Here are the top ones, ranked by their Reddit score.

Books
Computers & Technology Education
Schools & Teaching
Education & Teaching
GD Script: Godot 3.1 game engine
Check price on Amazon

1 Reddit comment about GD Script: Godot 3.1 game engine:

u/ArianDevelopmentComp · 2 pointsr/godot

hello, u/jaykyburz ,

Tree_exiting is the first signal after queue_free() and then tree_exited in the next frame.

  • tree_exited ( ) # Emitted after the node exits the tree and is no longer active.
  • tree_exiting ( ) # Emitted when the node is still active but about to exit the tree. This is the right place for de-initialization (or a “destructor”, if you will).

    For code example: Make a 2D scene with label and timer for example. Label with two signal tree_exiting and tree_exited, timer with Autostart, One-Shot, and WaitTime from 1.2.

    extends Node2D
    onready var test = false
    func _process(delta):
    if test == false:
    if $Label.is_inside_tree():
    print("Exiting")
    $".".print_tree_pretty()
    else:
    print("Exited")
    $".".print_tree_pretty()

    func _on_Timer_timeout():
    $Label.queue_free()
    test=true

    func _on_Label_tree_exited():
    print("Signal: Tree exited")

    func _on_Label_tree_exiting():
    print("Signal: Tree exiting")

    Explanation from the book "GD Script"

    https://www.amazon.com/GD-Script-Godot-game-engine-ebook/dp/B07VR8TVWC

    I hope this was useful.