Adding images to a Glulx game in Quixe

Hi all, this is my first post here…

I’m using Inform 6 (I know I should be using Inform 7) to make a Glulx game that will be played through Quixe on a web browser. I’d like to add images and while the documentation suggests it’s easy, I’m finding it difficult. I’ll skip all the background of the stuff I’ve tried…

According to the stuff I’ve read about Quixe image support, I shouldn’t have to worry about blorbifying my game file, Quixe can support graphics through that ‘StaticImageInfo’ thing, that’s where I get stuck.

I found “StaticImageInfo = {}” in media/resourcemap.js and I know the map object is supposed to look like this:

{
“image”: INT,
“url”: URLSTRING,
“alttext”: STRING,
“width”: INT,
“height”: INT
}

Can anyone help me get to where a line of code like below will display an image? I’m sure I need a resource file to define hackers_png, but I’m at a loss for how to get past this. Thanks

glk_image_draw(gg_mainwin, hackers_png, imagealign_InlineUp, 0);

Hi all, I figured it out, I ended up not modifying resourcemap.js, but I added the object map directly in game_option in index.html

<script type="text/javascript"> game_options = { image_info_map: { 1: { "image": 1, "url": "pict-1.jpeg", "width": 680, "height": 680 } }, use_query_story: false, set_page_title: true }; </script>

Seems to work like a charm

Hmm. Resurrecting this to see how this worked for you because I can’t get this to work at all.

I’m now trying to determine if image support is just broken or the use of images with Flexible Windows, in particular, is broken.

In the above, where did the key “1” come from? Did anything in the source have to reference that or did you just choose it? I ask because I read Quixe Graphics Support and it says:

But I have no idea what “Glk image numbers” are unless it just means any old integer.

Going on the assumption that this is what it means, when I use the above logic in my play.html file, however, substituting my own filename, of course, I get no image appearing. Likewise, I tried putting this in StaticImageInfo in resourcemap.js. That, too, does not seem to work.

It would have to be the same resource number as is set inside the blorb. Inform determines that when it compiles the game.

AH! That was it! Thank you.

A critical bit of info missing from just about everything I read on this was that in the Index, under List of Figures, you’ll see something like this:

Filename: “Figures/TesterStories.png” - resource number 3

It’s that resource number (which is apparently referred to as a “Glk image number” is just about all the documentation) that you have to use.