![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | extcFPjkCLsDC2F |
Can you please tell what purpose of lines :
yield(get_tree(), "idle_frame")
I tried to comment these lines with symbol #. But not detected any visible difference in execution. If possible please give detailed description.
in example :
func _ready():
viewport = get_node("Viewport")
viewport_sprite = get_node("televizor")
# Assign the sprite's texture to the viewport texture
viewport.set_clear_mode(Viewport.CLEAR_MODE_ONLY_NEXT_FRAME)
# Let two frames pass to make sure the screen was captured
yield(get_tree(), "idle_frame")
yield(get_tree(), "idle_frame")
viewport_sprite.texture = viewport.get_texture()
set_process(true)
your godot version?
volzhs | 2019-05-03 21:48