HobbesHK,

Managed to fix it by using await get_tree().process_frame instead. It seems that idle_frame appears to no longer exist in Godot 4.1?

So my full code for triggering the screenshot function is:


<span style="color:#323232;">func _on_SaveReport_pressed():
</span><span style="color:#323232;">	await get_tree().process_frame
</span><span style="color:#323232;">	$"%SaveReport".visible = false
</span><span style="color:#323232;">	$"%BackMainMenu".visible = false
</span><span style="color:#323232;">	await get_tree().process_frame
</span><span style="color:#323232;">	
</span><span style="color:#323232;">	take_screenshot()
</span><span style="color:#323232;">
</span><span style="color:#323232;">	$"%SaveReport".visible = true
</span><span style="color:#323232;">	$"%BackMainMenu".visible = true
</span>

For some reason, I have to await before I turn the interface elements off, and after I’ve turned them off. It now works a treat for my app. Thank you for your assistance!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • [email protected]
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • TheResearchGuardian
  • Ask_kbincafe
  • KbinCafe
  • feritale
  • Socialism
  • oklahoma
  • SuperSentai
  • KamenRider
  • All magazines