Showing A Sprite

Started by rock_chick, Mon 06/09/2004 10:31:45

Previous topic - Next topic

rock_chick

I've tried to found a way of displaying a picture file or sprite when a person looks at a inventory item but have not been able to find a way to do so. I tried using the change inv sprite option but that sprite didn't show up. Any help would be much appreciated!
Kat :)

Ashen

Do you mean like a zoomed-in image of the item? If so, the most obvious ways I can think of are:

1) Use CreateGraphicOverlay to show the image you want for a set time.
e.g.
Code: ags

int over1;
over1 = CreateGraphicOverlay(100,100,300,1); //Displays sprite 300 at co-ordinates 100, 100
Wait(200); // Waits about 5 seconds
RemoveOverlay(over1); // Removes image


A similar way would be to use RawDrawImage
Code: ags

RawSaveScreen (); // Store current screen
RawDrawImage ((100, 100, 300); //Displays sprite 300 at co-ordinates 100, 100
Wait(200); // Waits about 5 seconds
RawRestoreScreen (); // Removes image


2) Create a new GUI that appears on top of the Inventory, which shows the image you want, and use SetGUIBackgroundPic or SetButtonPic to set which item is displayed. This way is probably better than the first, as it would allow the player to decide how long it was displayed for. It would also make it possible to interact with the zoomed image (look more closely at details, open the box, etc.), but that would probably take a lot of scripting

3) Create a new room for each item, with the sprite either on the background, or as an object. This would let you play with the item, and would be easier than using a GUI. Might be a lot of new rooms, though.

There's probably a couple of other ways to do it, though. Hope this is some use anyway.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk