Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: TheRoger on Thu 11/03/2010 09:58:41

Title: Resolution and Inventory GUI trouble (SOLVED)
Post by: TheRoger on Thu 11/03/2010 09:58:41
I wanted to test how inventory GUI works with more than 10 item. And guess what? It doesn't work correctly... I'm using 9-verb MI-style template and script in it...

This is what I got, I press Down button, inventory items that are more to 10 appears for a part of second and then goes back again, I don't know what prob is. I got it when I changed screen resolution to 800x600. It looks like this:

http://www.youtube.com/watch?v=QMbek378G3c
Title: Re: Resolution and Inventory GUI trouble
Post by: Khris on Thu 11/03/2010 12:35:09
That's sort of a bug in the template.

The template's code checks continuously whether there's an inv item at coordinates 180;160 and if there isn't, scrolls the inventory one line back up.
The best way to rectify this is to rewrite the code to adjust the coordinates based on resolution and position of the GUI.

For now though you can change the coordinates to be in the middle of the first inv item field.
They are set in lines 106 & 107 in guiscript.ash.

I'll notify abstauber.
Title: Re: Resolution and Inventory GUI trouble
Post by: TheRoger on Thu 11/03/2010 13:24:42
It worked  ;D How did I missed that whole tab? Well thank you anyway, you saved my game and my time
Title: Re: Resolution and Inventory GUI trouble (SOLVED)
Post by: abstauber on Thu 11/03/2010 18:44:20
Hey Guys,
here's the "patch" ;)

around line 1371 in guiscript.asc

change from

if (InventoryItem.GetAtScreenXY(inv_xpos, inv_ypos)==null) MainInv.TopItem-=inv_items_row;


to

if (InventoryItem.GetAtScreenXY(gMaingui.X+MainInv.X+1, gMaingui.Y+MainInv.Y+1)==null) MainInv.TopItem-=inv_items_row;



Thanks for reporting! Maybe I should add a short high-res section to the manual.

Cheers!