HobbesHK

joined 1 year ago
[–] HobbesHK@startrek.website 1 points 1 year ago (1 children)

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:

func _on_SaveReport_pressed():
	await get_tree().process_frame
	$"%SaveReport".visible = false
	$"%BackMainMenu".visible = false
	await get_tree().process_frame
	
	take_screenshot()

	$"%SaveReport".visible = true
	$"%BackMainMenu".visible = true

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!

[–] HobbesHK@startrek.website 1 points 1 year ago (2 children)

await get_tree().idle_frame

Thank you for this! I just tried it out but unfortunately Godot throws an error on await get_tree().idle_frame : Invalid get index 'idle_frame' (on base: 'SceneTree').

Could it be because I'm running in application mode, which only refreshes the screen if there's an update?

As an alternative, I've put the code to turn things off into its own function:

func turn_off():
	$"%SaveReport".visible = false
	$"%BackMainMenu".visible = false

I've then tried an await turn_off()

The code runs, but doesn't do anything and the screenshot still gets saved with the buttons visible.

I'm trying both await functions just before the take_screenshot() function like so:

	await turn_off()
	await get_tree().idle_frame
	
	take_screenshot()

Am I missing something very obvious here? Any help would be much appreciated!

[–] HobbesHK@startrek.website 2 points 1 year ago (4 children)

I took away the 2 .visible = true commands at the end, just to see if they were the culprit. They are not. It appears that the get_viewport().get_texture().get_image() command gets called before the interface elements are turned off, even though the order of code would make me think otherwise.

[–] HobbesHK@startrek.website 2 points 1 year ago* (last edited 1 year ago)

Very excited about this update because it'll finally fix Godot minimising at random (and getting stuck) on Linux Gnome when using certain extensions. It's been a head scratcher for a long time!

[–] HobbesHK@startrek.website 4 points 1 year ago (1 children)

Thank you! I had a look through the documentation and managed to fix the error.

[–] HobbesHK@startrek.website 1 points 1 year ago

That is SUCH a useful tip. Thank you.

[–] HobbesHK@startrek.website 16 points 1 year ago (2 children)

I don’t miss it one bit as a social platform. I just wish that search engines wouldn’t prioritise it as much when I try to find a “how to do….” guide. It’s insane how many Reddit threads (half deleted and otherwise) dominate the results. Just show me a nice webpage please.

Without Adblock detection. And no bloody “how to” videos either. I just want to read it through, thank you.

[–] HobbesHK@startrek.website 3 points 1 year ago (1 children)

I’ve been on Manjaro for about 1.5 years now too. I switched over to the Unstable branch a while back, which fixed this issue for me. This branch seems to be getting all packages at the same speed as regular Arch. Plus, I still get the Manjaro-specific kernels, access to their repos, integrated pamac, etc. For now, I’m sticking with Manjaro this way.

[–] HobbesHK@startrek.website 3 points 1 year ago

I love his stuff - thanks for sharing this one! I’ve been trying to put a build mode together for a looooong time and this helped quite a bit.

[–] HobbesHK@startrek.website 1 points 1 year ago

Ah, thanks! I had indeed noticed the new transporter chief this season, wasn't sure if Kyle was going to make a surprise come back or not.

view more: ‹ prev next ›