Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sat 05/11/2005 14:27:37

Title: horizontal slide inventory
Post by: on Sat 05/11/2005 14:27:37
how to make an horizzontal slide inventory?
;D
Title: Re: horizzontal slide inventory
Post by: Ubel on Sat 05/11/2005 14:36:48
I'd suggest you to post a little more descriptive messages.

Please, elaborate. What kind of horizontal sliding do you exactly mean?
Title: Re: horizzontal slide inventory
Post by: on Sat 05/11/2005 17:27:30
I want that my inventory object slide horizontally instead vertically,one for click.
I wont place my object inventory of the bottom of the screen

I'm italian, I speak English a little.
Title: Re: horizzontal slide inventory
Post by: Ishmael on Sat 05/11/2005 23:18:51
Just make it one line high and set the scrolling to 1 item... I don't know exactly how to do it in the 2.7 script, you might want to try just the ScrollUp and ScrollDown commands with a one line inventory and see what happens, if you already haven't.

In the old scripting it was (this should go into interface_click under the condition for the inventory GUI):

Ã,  Ã,  if ((button == 4) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
Ã,  Ã,  Ã,  // scroll down
Ã,  Ã,  Ã,  game.top_inv_item = game.top_inv_item + 1;
Ã,  Ã,  }
Ã,  Ã,  if ((button == 5) && (game.top_inv_item > 0)){
Ã,  Ã,  Ã,  // scroll up
Ã,  Ã,  Ã,  game.top_inv_item = game.top_inv_item - 1;
Ã,  Ã,  }

Just replace the numbers after if ((button == to the numbers of your scroll buttons.

I'm not at all sure does it work properly in 2.7
Title: Re: horizzontal slide inventory
Post by: on Sun 06/11/2005 16:52:30
ok now I can scroll one object for click but I don't understand that I do to create an a horizzontally scrolling inventory at the bottom of the screen.


I want to create a inventory like this:
http://www.gmxmedia.net/blackmirror/screens/large/2vesvetes1K.jpg
Title: Re: horizzontal slide inventory
Post by: Ashen on Sun 06/11/2005 17:35:05
As Ishmael said, a one line inventory (as in that screen shot) will scroll horizontally. Just make the inventory GUI as normal with the InvWindow just tall enough for one item (22 pixels, by default), and use the ScrollUp/Down() commands (or that chunk of code, if you're using 2.62).
Title: Re: horizzontal slide inventory
Post by: on Tue 08/11/2005 19:12:03
 Thanks, Now works fine  ;D