Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Tue 10/05/2011 09:11:59

Title: SOLVED: scroll inv window to see replaced inventory items.
Post by: barefoot on Tue 10/05/2011 09:11:59
Hi

My player changes room and has his inventory lost and new ones replaced for that room.

I have done all the losing inventory and adding the new one's and they are indeed there.

Problem: only the last inventory item shows in inventory window. You need to scroll UP (north) inventory window to see other inventory items.

All Inventory items are given their ID when adding.

Obviously i want the inventory items to fill the Inv window replacing the previous once.

I can't seem to solve this issue at the moment. Can you help?

cheers

barefoot

Title: Re: Replaced inv items with new but have to scroll inv window north to see them..
Post by: Gudforby on Tue 10/05/2011 11:02:50
If the only problem is that the player have to scroll up the inventory window manually, couldn't you just add the InvWindow.ScrollUp command in the script after the inventory items are replaced?
Title: Re: Replaced inv items with new but have to scroll inv window north to see them..
Post by: barefoot on Tue 10/05/2011 11:15:08
Hi

Thanks for your post Gudforby

invCustomInv.ScrollUp(); works but as the manual states:

Quote
   will scroll the invMain inv window up one row.

I have vertical inventory window with 1 item per row so I need something to make it show more items (I have 7 inv items but obviously only so many in window due to height and width. maybe 5?)

barefoot
Title: Re: Replaced inv items with new but have to scroll inv window north to see them..
Post by: barefoot on Tue 10/05/2011 11:20:39
Hi

This may be off-hand but it works and now shows many items in inventory window:


        invCustomInv.ScrollUp();
invCustomInv.ScrollUp();
invCustomInv.ScrollUp();
invCustomInv.ScrollUp();
invCustomInv.ScrollUp();
       invCustomInv.ScrollUp();


barefoot



Title: Re: SOLVED: scroll inv window to see replaced inventory items.
Post by: Khris on Tue 10/05/2011 11:34:05
How about this instead:

  invCustomInv.TopItem = 0;
Title: Re: SOLVED: scroll inv window to see replaced inventory items.
Post by: barefoot on Tue 10/05/2011 12:40:40
Hi Khris

I'll give that a try.. it's less to add..

Thanks

barefoot