Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 12/11/2006 20:09:23

Title: Showing Images
Post by: on Sun 12/11/2006 20:09:23
Hello...

I would like to show images in my game. For example, when my hero looks a paper I want to show an image of this paper and everything that it is written on it. I can do this with two ways:
1) Play a video showing this picture.
2) Create a new room which will contain just a backround. Backround will be this image.

But, I would prefer a more optimized way to do this.

Thanx...
Title: Re: Images
Post by: Kweepa on Sun 12/11/2006 20:29:08
Optimized in what sense?
I would just use a new room.
It's memory efficient because it's only loaded when you go to that room.
It's performance efficient because the engine doesn't have to draw a background with your picture on top.
And it's extremely easy to code, because to return to the previous room you can use the PreviousRoom variable.
Title: Re: Images
Post by: Mikko on Sun 12/11/2006 20:36:20
I'd like to add, that with rooms you can of course have 5 different images by using the extra frames that normally are for animation.

Also this came to my mind. One way to do this without making new rooms would be making a gui and change the background of that gui depending what player is viewing. I must admit that i have no idea if that is smart in any way.
Title: Re: Images
Post by: Khris on Sun 12/11/2006 22:02:07
Using a GUI is fine, but there's another way:
RawSaveScreen();
RawDrawImage(x, 0, 0);   // replace with sprite slot of paper, adjust coords if nec.
WaitMouseKey(GetGameSpeed()*60*5);  // wait for mouse click or 5 minutes
RawRestoreScreen();
Title: Re: Images
Post by: R4L on Sun 12/11/2006 22:04:02
Why not just use an overlay?
Title: Re: Images
Post by: Ashen on Mon 13/11/2006 00:11:39
Please use a more descriptive thread title. I'd change it myself, but I'm not totally sure what your question is ...