Hi, I’ve implemented a ‘photo mode’ that will take a screenshot and save it to a folder in the project right now, but I wanted to get a way to display that photo in the game. I was following this tutorial: https://www.youtube.com/watch?v=3RDFEKDHRAk
And while it works perfectly with URLs to images, I couldn’t get the file path to work. Because the screenshots are saved by default to a specific path and named 0.png, 1.png, 2.png, etc… I thought it wouldn’t be too difficult to pull the images and display them in game, but it’s proving to be harder than I expected.
Does anyone have advice on how to get these images to display in game? I don’t even necessarily need the screenshot pngs if I can just get the images to be visible in game.
For the end goal I’d like to have a widget whose image can update dynamically in-game, but it doesn’t seem like I can set the image of a widget, as the variable is not set to public and can’t be edited.
Hi, sorry for the late response. They’re not premade URLs, which is the issue; I’m trying to get the file directly from whatever machine is running the project. According to the tutorial I linked, you can use the direct file path to display the image, but when I tried using my file path it failed. It’s just a normal file path, i.e. C:.…\WindowsEditor, and the images are named 0.png, 1.png, so forth so on, and are screenshots taken during runtime.
The file name is quite a bit longer than that, but I pasted it as shown in the tutorial video and it didn’t work. Ideally, I’d like to switch the image displayed in a widget to show this screenshot instead.
Ideally that would’ve worked better, however the game is based around taking pictures in-game. I suppose one way to work around that would be to store a bunch of png images beforehand and override them with the screenshots? However that would put a limit on the number of pictures the player could take.
There is a node “Import File as Texture 2D” that takes a file path and outputs a texture object that you can plug into the Image with “Make Brush From Texture”.