So, you've decided you want to drop a picture directly in with the text of your IF story. This is actually relatively simple: just call glk_image_draw() with four arguments:
1) The name of the window the image is being sent to. Unless you're doing something very unusual with your window layout, mixing images with your story text will mean sending them to gg_mainwin.
2) The name of the picture to be shown, as you named it in your Blorb resource file. If the picture is of a monkey, for instance, you might call it "Monkey_pic".
3) The way you want text to flow around the object. Here you have five options. The first three are for if you want the picture to be placed as if it were just another word on that line of text where it appears. Perhaps the best way to demonstrate what each option does is with some diagrams:
imagealign_InlineUp:
The quick brown monkey jumped over the ################ # # # (Monkey_pic) # # # lazy dog. ################ The quick brown monkey jumped over the lazy dog.
imagealign_InlineDown:
The quick brown monkey jumped over the lazy dog. ################ The quick # # # (Monkey_pic) # # # ################ brown monkey jumped over the lazy dog.
imagealign_InlineCenter:
The quick brown monkey jumped over the ################ # # lazy dog. # (Monkey_pic) # The quick # # ################ brown monkey jumped over the lazy dog.
Naturally, if the picture is the only thing on the line in question, you can choose any of these and it'll look the same.
The other two options only work if the image is the first thing on the line (ie, following a ^ character in a string or a "new_line;" call.) Any text that follows will be wrapped around the image thusly:
imagealign_MarginLeft:
################ The quick # # brown monkey # (Monkey_pic) # jumped over # # the lazy dog. ################ The quick brown monkey jumped over the lazy dog. The quick brown monkey jumped over the lazy
imagealign_MarginRight:
The quick ################ brown monkey # # jumped over # (Monkey_pic) # the lazy dog. # # The quick ################ brown monkey jumped over the lazy dog. The quick brown monkey jumped over the lazy
4) The fourth argument is 0. This argument is only meaningful when drawing to a graphics window; however, we can't just leave it off, because unlike regular Inform functions, Infglk functions cannot deal with being passed fewer arguments than they are expecting.
So, let's say that we want this monkey picture to be displayed when the player elects to have the player character go to the zoo and >LOOK AT THE MONKEY. We might code the monkey as follows:
Object monkey "Bobo the monkey" with name 'monkey' 'bobo', description [; print "The monkey looks like this:^"; glk_image_draw(gg_mainwin, Monkey_pic, imagealign_InlineUp, 0); print "^"; rtrue; ], has animate proper;
Of course, there's always the possibility that the player is using an interpreter that doesn't support graphics, in which case the image will fail to load and the player will be left with just a blank line after the "like this:" part. For information on how to deal with this possibility, see the section on Capabilities testing.