Is there a way to make a compiled file show picture of game?

As title says I have been trying to make a compiled file show game cover picture but I can’t.

Anyone know how? If so can you show a step by step? Thanks.

I tried to search the forum using my phone, but no hits on the search bar. I did find this Pictures not showing up in compiled version but it old like 2014. Perhaps now it possible? :disappointed:

1 Like

In the new version of CSIDE you can import images as data URIs.

To do this manually, grab an image and run it through an image to data URI convertor, such as:
https://websemantics.uk/tools/image-to-data-uri-converter/

(There’s loads on the web, just Google).

Once you have your base64 data uri (a HUGE string of random characters), create a new scene file in your project. Name this scene file my_image.txt and paste in the data uri. Before the data uri type *image … So it’s essentially *image my_data_uri.
After the data uri, on a new line, place a *return.

Now you can do *gosub_scene my_image.txt wherever you want this image to appear. As long as you include this file during compilation it will also work in a compiled game :slight_smile:

Downside: there’s a slight overheard in terms of image size, I think it’s typically a 33% increase on the original image size for data URIs.

2 Likes

Yay! :grin: That is what I’m looking for. Thanks much for the solution. Finally, I not mind the increase on the original image size for data URIs. I just want image to work properly.

Once again thank you very much, I’ve been whacking my brains for solution or ways. I can’t think of nothing. I say what you’ve given is my best solution to my dilemma. :bow:

1 Like

Alternatively simply stick them in the same folder as the HTML. That is if your game is located at:
http://retowers.neocities.org/Game Name/Game Name.html
Then your image should be:
http://retowers.neocities.org/Game Name/image_name.html

2 Likes

I’m not using neocites, I’m using the GitHub which makes errors if I add an image file to my HTML folder file. But that tip is good if I ever switch to neocites :thumbsup: