Dr_Nomz
Member
I have a chest that displays it's inventory slots (buttons) when opened, and I got it set up to have multiple pages for it's inventory, which is great, except that it isn't displaying correctly.
The way it works is it's in a case statement, once the next page button is pressed, it switches the case(page) from 0 to 1, displaying the for loop for the rest of the slots instead.
But it shows them like it would if they were all drawn at the same time, because of how it's set up, even though it's supposed to start from the top just like the first loop.
This is the first loop:
On the second, it has for(c = 10; c < 20; c += 1) and displays them below where the old buttons used to be. How do I make it so they display correctly, just like the first ones?
The way it works is it's in a case statement, once the next page button is pressed, it switches the case(page) from 0 to 1, displaying the for loop for the rest of the slots instead.
But it shows them like it would if they were all drawn at the same time, because of how it's set up, even though it's supposed to start from the top just like the first loop.
This is the first loop:
Code:
for (c = 0; c < 10; c += 1){
var ix = x1+840+((c%2)*104);
var iy = y2+101+(floor(c/2)*104);
draw_sprite(spr_Item_Slot_3,0,ix,iy)
button[c].show_button=true;
button[c].x = ix;
button[c].y = iy;
}