Vertical inventory scrolling

Started by DragonRose, Thu 23/10/2003 18:28:21

Previous topic - Next topic

DragonRose

Is it possible to scroll inventory items from left to right instead of just up and down?  I haven't been able to find anything in the manual about it.
Sssshhhh!!! No sex please, we're British!!- Pumaman

DragonRose

#1
Okay, maybe I didn't explain what I'm trying to do so well.  I shall now add... PICTURES!



I just thew this together, so things don't quite line up.  Anyway, what I want to happen is that when you click on the left arrow, the guitar case will go to the spot of the dress, the library card goes to the space of the guitar case, the book goes to the space of the library card and so forth.  If you click the right arrow, the opposite would happen.

LucasArts inventory is set up sort of like a grid, with the up and down arrows changing what row you're looking at.  If we were to look at the row beneath this image, it would be a whole different set of images.   I just want to bump things along one item at a time.
Sssshhhh!!! No sex please, we're British!!- Pumaman

Ishmael

First, set the inv info to match your inv window, ie. set the global variables game.items_per_line and game.num_inv_displayed to the right values, then, set the inv scroll code so that you scroll just one item at a time.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Paper Carnival

#3
No worry my friend!!

Quoteif ((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;
}

button4 is supposed to be the previous button and button 5 the next one. Note that I just changed the programming of the default code to scroll the inventory, so instead of scrolling a whole page left or right it just scrolls one item  ;D

Yeah! I just made my first helpful (towards somebody) post! I'm not a newbie anymore! :D

:P

EDIT: Well, I started to write this post before I read the other answer :P. It just took me a while to write the code down and check it, that's all...

Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk