images...

*edited title name as I accidently put the wrong extension up ( i previously tried that extension, sorry)

So I have been reading every post on the I7 forums that has the word image in it to try and get a handle on this, but I am just not getting something. Here is the code pertaining to images:

[code]
Include the Basic Screen Effects by Emily Short.
Include the Glulx Entry Points by Emily Short.
Include the Glimmr Canvas-Based Drawing by Erik Temple.

Figure of intro is the file “intro.jpg”.
Figure of greetingtalk is the file “greetingTalk.jpg”.
Figure of greetingwave is the file “greetingWave.jpg”.

The graphics-window is a graphics g-window spawned by the main-window. The position is g-placeabove. The measurement is 200. The back-colour is g-dark-grey.

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

The current image is a figure-name that varies. The current image is Figure of greetingwave.

To depict (f - a figure-name):
change the current image to f.

Carry out looking:
depict figure of intro;
continue the action.

When play begins:
open up the graphics-window;
depict Figure of greetingwave;
say, “Welcome…”
wait for any key;
clear the screen;
depict Figure of greetingtalk;
say, “Blah, blah, blah!”
wait for any key;
clear the screen;
continue the action.[/code]
No picture displays at all. I can get a picture to display by putting in:

The background image is Figure of greetingwave.

But it will not change the image.
So I tried changing:

To depict (f - a figure-name): change the current image to f.
to:

To depict (f - a figure-name): change the background image to f.
(since it seemed to at least understand and carry out the background image…)
That gives me a P31 error and still doesn’t change the image.

If anyone could please help me out with this, I would be eternally grateful!

I know I am doing something wrong but I don’t know what.

It doesn’t display then on the IDE or on the build? Or both?

I’ve found sometimes my IDE won’t show me the pictures, but if I release the story, the pictures are there.

Well I just tested out your theory, but it doesn’t work either way.

Drat, I used Graphical Window Sprites with my last project and got that working fine (in the build also)… I thought handling one image at a time would be a much easier task, but I guess not.

Please, if anyone could help me out, I just don’t get what I am doing wrong.

There are a couple of problems here:

  1. You don’t have any code to actually display the current image–all your “depict” phrase does is change the current image variable to a new figure name.
  2. The reason you get the P31 error is that Glimmr Canvas-Based Drawing is designed to use multiple windows, so when you assign a background image to a canvas, you need to do specify which one. In other words, when you write “The background image is Figure of greetingwave,” Inform interprets that as “The background image [of nothing] is…”, and you get a runtime error. To get this to work, you need to say The background image of the graphics-canvas is Figure of greetingwave. You’ll also need to redraw the window using “follow the window-drawing rules for the graphics-window” at an appropriate point in your code.

However, if all you want to do is show a single image, Glimmr Canvas-Based Drawing is really overkill (it’s a souped-up version of Graphical Window Sprites). You might want to use Simple Graphical Window instead, which has simple built-in drawing rules. I believe that Jon Ingold has made that extension compatible with Flexible Windows, despite the differences in approach between the two extensions. Of course, if you’re going to do other things in other graphics windows, the Glimmr extension might be more appropriate.

–Erik

Well, I want to use more than one image, just one at a time though. I just want to be able to change the image for certain events.

Thank you so much, Erik! I had tried both of those phrases, just not in combination with eachother. :laughing:
The new working code is:

[code]
Include the Basic Screen Effects by Emily Short.
Include the Glulx Entry Points by Emily Short.
Include the Glimmr Canvas-Based Drawing by Erik Temple.

Figure of intro is the file “intro.jpg”.
Figure of greetingtalk is the file “greetingTalk.jpg”.
Figure of greetingwave is the file “greetingWave.jpg”.

The graphics-window is a graphics g-window spawned by the main-window. The position is g-placeabove. The measurement is 200. The back-colour is g-dark-grey.

The graphics-canvas is a g-canvas. The associated canvas of the graphics-window is the graphics-canvas. The background image of the graphics-canvas is Figure of greetingwave.

To depict (f - a figure-name):
change the background image of the graphics-canvas to f;
follow the window-drawing rules for the graphics-window.

Carry out looking:
depict figure of intro;
continue the action.

When play begins:
open up the graphics-window;
depict Figure of greetingwave;
say “blah, blah, blah…”;
wait for any key;
clear the screen;
depict Figure of intro;
continue the action.[/code]
THANK YOU AGAIN!!

That’s what I meant… Anyway, glad you got it working!

Forgive me necromancing this old topic, but I (perhaps unwisely) used this topic to toy with graphical extensions for i7 and quickly ran into troubles. After going down the rabbit hole of extension installations (please install this, now this, now this…) I finally stopped receiving errors asking for additional mentioned extensions only to have a shopping list of complaints about the contents of those very extensions. Including both the code I tried using as well as the Failure report from i7. I would deeply appreciate some assistance here.

Thanks.

Include the Basic Screen Effects by Emily Short.
Include the Glulx Entry Points by Emily Short.
Include the Glimmr Canvas-Based Drawing by Erik Temple.

Figure of intro is the file “intro.jpg”.
Figure of both is the file "both.gif".
Figure of allsun is the file “allsun.png”.
Figure of nosun is the file “nosun.png”.

The graphics-window is a graphics g-window spawned by the main-window. The position is g-placeabove. The measurement is 200. The back-colour is g-dark-grey.

The graphics-canvas is a g-canvas. The associated canvas of the graphics-window is the graphics-canvas. The background image of the graphics-canvas is Figure of intro.

To depict (f - a figure-name):
change the background image of the graphics-canvas to f;
follow the window-drawing rules for the graphics-window.

When play begins:
open up the graphics-window;
depict Figure of intro;
say “мне крышка…”;
wait for any key;
clear the screen;
depict Figure of both;
continue the action.
Failure Report

(Each time Go or Replay is clicked, Inform tries to translate the source text into a working story, and updates this report.)

In Chapter 1 - Basic definitions, Section 1 - Defining a fixed point number in the extension Fixed Point Maths by Michael Callaghan:

Problem. In the sentence ‘-999999.9999 specifies a real number with parts whole and fractional’ , it looks as if you intend to give a new meaning to expressions like ‘-999999.9999’, but this is already something I recognise - specifying a real number - so a more distinctive specification must be chosen.

See the manual: 15.9 > 15.9. Multiple notations


In Section 2 - Constants for precision in the extension Fixed Point Maths by Michael Callaghan:

Problem. Before reading ‘Pi is 3.1416’ , I already knew that ‘Pi’ is a real number and ‘3.1416’ likewise: so they are specific values, and saying that they are equal will not make it so.


In Part - Element Definition, Chapter - Concealing elements, Section - Revealing elements for debugging (not for release) in the extension Glimmr Canvas-Based Drawing by Erik Temple:

Problem. The sentence ‘A g-element is publically-named’ seems to tell me that ‘g-element’ and ‘publically-named’ have to be the same, but it looks odd to me. ‘g-element’ is something generic - not something definite; but ‘publically-named’ is (presumably) something specific. So it’s as if you’d written ‘A room is the Sydney Opera House’. (Which room, exactly? You see the trouble.)


In Part - Sprites, Chapter - The primitive base class in the extension Glimmr Canvas-Based Drawing by Erik Temple:

Problem. You wrote ‘A primitive has a glulx color value called the tint’ , but ‘glulx color value’ is not the name of a kind of value which I know (such as ‘number’ or ‘text’).

See the manual: 4.8 > 4.8. New value properties


In Section - Stroked rectangle primitive in the extension Glimmr Canvas-Based Drawing by Erik Temple:

Problem. You wrote ‘A stroked rectangle primitive has a glulx color value called the background tint’ , but ‘glulx color value’ is not the name of a kind of value which I know (such as ‘number’ or ‘text’).


In Chapter - Bitmap base class in the extension Glimmr Canvas-Based Drawing by Erik Temple:

Problem. You wrote ‘A bitmap has a glulx color value called the tint’ , but ‘glulx color value’ is not the name of a kind of value which I know (such as ‘number’ or ‘text’).


Problem. You wrote ‘A bitmap has a glulx color value called the background tint’ , but ‘glulx color value’ is not the name of a kind of value which I know (such as ‘number’ or ‘text’).


In Chapter - Rendered strings, Section - Rendered string base class in the extension Glimmr Canvas-Based Drawing by Erik Temple:

Problem. You wrote ‘A rendered string has a glulx color value called the tint’ , but ‘glulx color value’ is not the name of a kind of value which I know (such as ‘number’ or ‘text’).


Problem. You wrote ‘A rendered string has a glulx color value called the background tint’ , but ‘glulx color value’ is not the name of a kind of value which I know (such as ‘number’ or ‘text’).


In Chapter - Image-map base class in the extension Glimmr Canvas-Based Drawing by Erik Temple:

Problem. You wrote ‘An image-map has a glulx color value called the background tint’ , but ‘glulx color value’ is not the name of a kind of value which I know (such as ‘number’ or ‘text’).


In Part - Debugging commands for image-maps, Chapter - Graphlink preview in the extension Glimmr Canvas-Based Drawing by Erik Temple:

Problem. The sentence ‘The graphlink preview color is a glulx color value variable’ appears to say two things are the same - I am reading ‘graphlink preview color’ and ‘glulx color value variable’ as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that ‘Laurel is Hardy’. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance ‘Blue-Ridge Mountains is a lighted room’ says that something called Blue-Ridge Mountains exists and that it is a ‘room’, which is a kind I know about, combined with a property called ‘lighted’ which I also know about.


Problem. The sentence ‘The graphlink preview color is usually g-Light-Grey’ appears to say two things are the same - I am reading ‘graphlink preview color’ and ‘g-Light-Grey’ as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that ‘Laurel is Hardy’. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance ‘Blue-Ridge Mountains is a lighted room’ says that something called Blue-Ridge Mountains exists and that it is a ‘room’, which is a kind I know about, combined with a property called ‘lighted’ which I also know about.


In the main source text:

Problem. The sentence ‘The back-colour is g-dark-grey’ appears to say two things are the same - I am reading ‘back-colour’ and ‘g-dark-grey’ as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that ‘Laurel is Hardy’. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance ‘Blue-Ridge Mountains is a lighted room’ says that something called Blue-Ridge Mountains exists and that it is a ‘room’, which is a kind I know about, combined with a property called ‘lighted’ which I also know about.

Problems occurring in translation prevented the game from being properly created. (Correct the source text to remove these problems and click on Go once again.)

Edited to add: I created a new topic instead. Sorry for poking an old topic like this.