+1 vote


Ever see one of those awesome dungeon generators that paints the tiles one by one for you to view in amazement? If not, check it out: Awesome Dungeon Generator

My question is in Godot, how to I manage to add_child one by one so they appear on screen one by one. I have tried a few different approaches without success.

  1. My tile generator being call_deferred and my tile painter (the function that adds children) on the main thread.

  2. Tile painter on call_deferred and tile generator on main thread.

  3. Both the tile generator and the tile painter on main thread and both on call_deferred

In all cases the function has to finish before the map is displayed and it just updates all at once (no cool tile by tile effect). The trigger is in a button, not in an init or ready.

Thanks for any tips.

in Engine by (146 points)

1 Answer

+1 vote

use yield(get_tree(), "idle_frame") inside for,while loop should do the trick

by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.