Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: dcalap on Sat 30/11/2019 20:59:40

Title: Show an inventory object in the middle of the screen
Post by: dcalap on Sat 30/11/2019 20:59:40
Hi,

Let's say I have a photo in my inventory and I want to show this photo in the middle of the screen in real size when the player looks at the inventory item.

How can I do this? What is the best way to do that?

Thanks!
Title: Re: Show an inventory object in the middle of the screen
Post by: Cassiebsg on Sat 30/11/2019 21:45:19
I can think of a couple ways, the best way I can't say.

You can use a dynamic sprite and show it in the middle of the screen.
You can use a GUI and show the image in it.
Some other solution I'm not thinking of?

Anyway, use whichever serves your purposes. I would most likely use a GUI, but that may not be the "best" solution.
Title: Re: Show an inventory object in the middle of the screen
Post by: Crimson Wizard on Sat 30/11/2019 22:13:19
Quote from: Cassiebsg on Sat 30/11/2019 21:45:19
You can use a dynamic sprite and show it in the middle of the screen.

Note, you cannot "just" show a sprite, you need to place it on something, so probably you meant object or overlay?

IMHO GUI is the good first option, because a) it does not depend on room, b) it gives you bit more control than overlay. If that does not work for some reason, then look for other alternatives.
Title: Re: Show an inventory object in the middle of the screen
Post by: dcalap on Sat 30/11/2019 22:16:30
Worked with the GUI. Thanks guys! :)
Title: Re: Show an inventory object in the middle of the screen
Post by: eri0o on Sun 01/12/2019 03:26:47
If you are going to have many different photos, you can use the same GUI and make a function for showing it that receives a sprite, so you apply it either to it's background or a button.

Also a reminder that this function exists:

https://adventuregamestudio.github.io/ags-manual/GUI.html#guicentre