Glimmr extensions by Erik Temple - Requesting assistance

Thank you very much, @severedhand . I’ve included the demo as requested. Please let me know if I didn’t do it correctly and need to do it again. Thank you. I didn’t include Basic Screen Effects (Version 7/140425) by Emily Short because it is built in to 6M62 Inform.

Glimmr_demo_with_extensions.zip (1.7 MB)

I think that the main thing that was missing from your code example was to tell the extension where to spawn the graphics window from. So, instead of this line:
The graphics-window is a graphics g-window., we need:

The graphics-window is a graphics g-window spawned by the main window.

By the way, it’s best to post code examples using the “preformatted text” button in the editor, which looks like this: </>. That will preserve the indentation and the quotation symbols in the code (no typographical curly quotes etc.).

Here’s a minimal example which compiles and shows a picture:

Include Glimmr Canvas-Based Drawing by Erik Temple.

Figure of intro is the file "placeholder1.png".

The intro is a sprite. The image-ID of the intro is Figure of intro.

The graphics-window is a graphics g-window spawned by the main window. 

The graphics-canvas is a g-canvas. 

The associated canvas of the graphics-window is the graphics-canvas. 

The associated canvas of a g-element is the graphics-canvas.

The background image of the graphics-canvas is Figure of intro. 

When play begins:
	open up the graphics-window;

The demo is a room. "Demo room here."

After jumping:
	say the complete list of extension credits.

The last part is of course not necessary for the example, it’s only so that we can easily see all extensions, even those which are not shown with the VERSION command (another way is to look at the Contents tab of the Index in the IDE). The output (of JUMP) on my machine is:

Standard Rules version 3/120430 by Graham Nelson
English Language version 1 by Graham Nelson
Glimmr Canvas-Based Drawing version 4/160626 by Erik Temple
Flexible Windows version 15/200719 by Jon Ingold
Glimmr Drawing Commands version 3/160626 by Erik Temple
Alternative Startup Rules version 1/140516 by Dannii Willis
Glulx Entry Points version 10/200602 by Emily Short
Glulx Text Effects version 5/150123 by Emily Short
Glulx Definitions version 1/160919 by Dannii Willis
Glk Object Recovery version 1/171025 by Dannii Willis
Glk Events version 1/160919 by Dannii Willis

4 Likes

You were right about including the spawn line. But that wasn’t enough to fix the problem alone.

The original reason I didn’t have the “spawned by the main window.” section was it would result in an error, so I removed it to get the code to compile. Also, if I included Flexible Windows by Jon Ingold, it did the same thing. I did not connect these two things together as related and I should have.

Turns out I had somehow updated all the other extensions, but not Flexible Windows. Once I updated Flexible Windows to version 15/200719 and reintroduced “…spawned by the main window,” Boom, images. I’m now in business.

Thank you very much!

P.S. I will remember the formatting tip for posting code, thank you.

Edit to add: P.P.S. I’m pretty sure the answer is no, but just to verify, no *.gif usage with Glimmr, right? Only static images like jpegs or pngs?

3 Likes

Yes, as far as I know. From the docs for Glimmr Canvas-Based Drawing:
“The image files used with sprites can be in PNG or JPEG format.”
Even apart from the Glimmr extensions themselves, I don’t think many (any?) interpreters support animated GIFs.

For building animations, you could try Glimmr Canvas Animation, also by Erik Temple: extensions/Erik Temple/Glimmr Canvas Animation.i7x at development · i7/extensions · GitHub

I know you mentioned in the OP that you’re experimenting with graphical extensions at the moment, and that’s of course perfectly fine and a good way to get to know what’s available (and good to keep the collective knowledge up-to-date).

But having said that, I’d like to add that if you’re looking to just do something basic like displaying an image, for example a picture for each location, I’d recommend using the extensions Location Images and Simple Graphical Window by Emily Short.

Or, on the other hand, if you’re looking to implement significant amounts of multimedia, I’d say your best bet would be Vorple, since then you can combine Inform7 with the capabilities of HTML5 and JavaScript.

1 Like