[SOLVED]Scroll straight to top of inventory.

Started by Stranga, Mon 22/03/2021 10:31:48

Previous topic - Next topic

Stranga

Hello everyone,

I was wondering if there was a way to scroll (jump) straight to the top item in an inventory window. I'm aware of InventoryWindow1.ScrollUp() but I'm looking for a way to jump straight to the first item every time you open up the inventory. Any help would be greatly appreciated :) 

EDIT: All good, solved it myself. Was having a major mental block haha! :S

Code: ags

  if (InventoryWindow1.TopItem > 0) 
  {
  InventoryWindow1.ScrollUp();
}



Matti

#1
The example for InvWindow.TopItem in the manual deals with exactly that  :)

Code: ags
while (InventoryWindow1.TopItem > 0) {
  InventoryWindow1.ScrollUp();
}

Stranga

Thanks Matti :)

That's where I found found it haha! I had the biggest brain fart when I saw it!

SMF spam blocked by CleanTalk