Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Scavenger on Tue 15/03/2016 05:00:31

Title: My inventory window isn't scrolling!
Post by: Scavenger on Tue 15/03/2016 05:00:31
I'm trying to program the UI for my game, and I've run against a weird snag that I can't solve. The inventory window simply does not scroll when invWindow.ScrollUp/Down is called. My InventoryWindow is set to have 2 rows of 4 items, 17x17 in size (the item graphics themselves are 16x16 but I need a 1 pixel buffer between them), and whenever I call the ScrollUp/ScrollDown functions.... nothing happens, even when I have more than 8 items in my inventory.

What could be causing this? There's nothing in any of my rep_execs that sets the Inventory Window, it's all done in the on_mouse_click, and the GUI buttons for scrolling the inventory - and even when I set the ItemWidth/ItemHeight to 16, it still wouldn't scroll. Nothing I'm doing with it is working.
Title: Re: My inventory window isn't scrolling!
Post by: Slasher on Tue 15/03/2016 05:25:30
Have you checked that the inventory window's name is related to the scroll buttons?
Title: Re: My inventory window isn't scrolling!
Post by: Scavenger on Tue 15/03/2016 05:35:03
There's only one inventory window in my game, it's called invWindow. I even changed it's name to mainInv to see if it was some sort of weird case sensitive thing, because reading variables from it seems to work.

Still no scrolling, though. I can't even manually set it with mainInv.TopItem.
Title: Re: My inventory window isn't scrolling!
Post by: Slasher on Tue 15/03/2016 05:48:42
have you checked the buttons (arrows) click area sizes?
Title: Re: My inventory window isn't scrolling!
Post by: Crimson Wizard on Tue 15/03/2016 11:18:17
Quote from: slasher on Tue 15/03/2016 05:48:42
have you checked the buttons (arrows) click area sizes?
In other words, can you double-check that your scrolling/top item setting function is actually being called.
Title: Re: My inventory window isn't scrolling!
Post by: Scavenger on Tue 15/03/2016 16:40:26
Yes, the functions are being called, they just don't do anything. Everything except the things I need (ScrollUp/Down and TopItem) are being run.

Putting Displays before and after the function calls proves they should be being run, but nothing happens.
Title: Re: My inventory window isn't scrolling!
Post by: Slasher on Tue 15/03/2016 16:46:05
You could try lessening the width of the inv window (to make more rows) and see if the scrolls work then..

or make another inv window somewhere with scroll buttons and see if they work..

food for thought...
Title: Re: My inventory window isn't scrolling!
Post by: Scavenger on Tue 15/03/2016 18:05:28
Ah, found the issue, CharacterToUse was constantly being set, so it was always being reset to TopItem 0. I had forgotten that I had done that.

Sorry! I didn't know that would happen.