Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ytterbium on Sat 03/04/2004 22:56:12

Title: LucasArts inventory scrolling
Post by: Ytterbium on Sat 03/04/2004 22:56:12
I'm trying to get my inventory window to scroll, but whenever I click a scroll button, the cursor mode is rendered unchangable and I have to quit the game. Oh, and it doesn't work. Here's a diagram:

Displayed area is between *'s
*1 2 3 4 5* 6

I'm trying to change it to...
1 *2 3 4 5 6*

I use...

 else if (button == 5) {
     // scroll down
     game.top_inv_item += 1;
   }
   else if (button == 4){
     // scroll up
     game.top_inv_item -= 1;
   }


in the inventory script, but this code causes the problem to occur. Help!
Title: Re:LucasArts inventory scrolling
Post by: Scummbuddy on Mon 05/04/2004 07:54:14
This is what my code looks like.  Maybe it can give you some ideas?


      if ((button == 10) & (game.top_inv_item < game.num_inv_items - 7))
         game.top_inv_item = game.top_inv_item + 4;
      if ((button == 9) & (game.top_inv_item > 0))
         game.top_inv_item = game.top_inv_item - 4;