How can I have images pop up into a browser?

Godot Version

Godot 4.3

Question

For the project that I’m working on, I need to have certain actions trigger “clues”, which are images that are sent to your browser. The main idea I had was having a folder in the game that I can call these images from, and have them pop up in a browser, reason being I don’t want to be reliant on a website so the player can play offline.

I managed to get video pop-ups to work by using OS.shell_open, however the input uses the User’s name, so anyone other than me using it, won’t see it. I have a folder that I can call, however it doesn’t open through the user’s default video viewing app.

Any solutions would be extremely helpful!

You can try the command line again but do a file url.

For windows:

start "file:///path/to/file"

You will probably need your application to save the internal images to its user folder. Resource saver should defualt to the user:// path, then you get the real user path and past ot into the command above.

I havent tried this but the file url, i hope, will start the defualt browser.

You can use FileAccess to get the user:// folder absolute path.

1 Like

Do you know how I’d be able to use FileAccess to open the files? If I can’t get it to open in a browser, I’d be alright with just having it as the default file app.

i thin you need to use the code from here: ProjectSettings — Godot Engine (4.3) documentation in English

and then call OS.shell_open(path) with the path it got