Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Vincent on Fri 24/06/2016 00:31:40

Title: Custom Inventory
Post by: Vincent on Fri 24/06/2016 00:31:40
Good Evening to all AGSer :)

I'm trying to write something approximately simple but I'm having some difficulty.
I hope someone can help me out in the free time.

I love how AGS handle the selected inventory graphic for the mouse cursor anytime you click on a item.
I have an InventoryWindow with some little boxes where is placed the items that you collect.

This is what I'd like to do :

A) Anytime you click the item, the cursor graphic change to the current item graphic that you select.
B) After you select that item the box will look empty
C) If you click on the empty box the item return to the box and the mouse cursor change to the default one

Do you know what is the best way to do that ?

Thank you very much in advance :)
Title: Re: Custom Inventory
Post by: Mandle on Fri 24/06/2016 14:14:56
I would say just make a dummy blank sprite and change the inventory item's image to that sprite whenever it is selected, and then change it back when it's clicked on again (and the player currently "HasInventory" or whatever that command is...if you need the extra check)
Title: Re: Custom Inventory
Post by: Vincent on Fri 24/06/2016 22:40:12
Thank you a lot Mandle :)
I figure out what you said in the message and it is just working good :)
Also, the 'HasInventory' command did the trick as well, thanks again for the support :)
Title: Re: Custom Inventory
Post by: Mandle on Fri 24/06/2016 23:53:41
Glad to hear my muddled late-night ramblings actually made some kind of sense! :)
Title: Re: Custom Inventory
Post by: Cassiebsg on Sat 25/06/2016 23:38:46
And this is how you know that you're no longer a novice when coding with AGS... That awesome moment when you realize you have the answer to a question. ;)
Title: Re: Custom Inventory
Post by: Mandle on Sun 26/06/2016 09:30:29
Quote from: Cassiebsg on Sat 25/06/2016 23:38:46
And this is how you know that you're no longer a novice when coding with AGS... That awesome moment when you realize you have the answer to a question. ;)

And then Khris pops in and says "Or why not just do this...It is after all what it was designed to do..."

(Just kidding Khris: You're awesome! Never leave us!)