Custom Scroll Box Creation

I have a scroll box that I populate using a foreachloop. I’d like the scroll box to consist of pages of items instead of just items.
I’d like each page to accommodate a maximum of 8 items. So if there are 9-16 items, a second page is created and it can be scrolled to. Similarly, if there are 17-24 items, a third page can be scrolled to.
I don’t want there to be a limit on items or pages.
Thanks!

This can very quickly become very complicated, but Ill bulletpoint it and hopefully it helps.

1 check the lenght of the array used, and here decide on how manny pages you want to spawn and set a reference for it, allso create a reference on the total number of items to be spawned and is currently spawned.

2 do a for loop for as manny number of pages you want to spawn using previously set pages ref.

3 inside that foor loop you check the number of items to be spawned, using the saved item ref and created items ref.

4 create another for loop as long as the number of items you want to spawn.

5 loop it and spawn the items.

save how manny items that were created. //loop 3 untill done

//loop 2 untill done

profit

I’m sorry but I didn’t understand much from that. Could you please post pictures? They would be extremely helpful. Thanks!

made a boiled down funktion that does what I described, but this needs more specifics to be what you want Im guessing - but here goes.

I created this in the level bp, but you can allso put it in some other widget blueprint, or the player controller for example.

To make this I created 3 widgets, one “book” widget that has a scrollbox, secound a “page” widget that also has a scrollbox, (and no canvas so it can be added as a child), and lastly a “item” widget, (that also has no canvas).

the “book” and “item” widgets could contain anything, it doesnt realy matter. But since I made a simple scrollbox they will all be in the same scrolling list, if you want more complex functionality you would need to add that.

the end result from this is a scrollbox that cointains more scrollboxes that atm containing 10 items each, any number of pages or items in any size can be added to this.

As a last note I would recommend you to maybe look for a simpler way to make you inventory or whatever your making, since these types of systems get very complicated when you add variations and art etc.

hope this helped and good luck.

Thank you so much! This works really well. Last issue that I have is u can be in between pages. Is there any way I can make sure the user is on a specific page?

The function we have for now is only the bare-bone spawning so -
you would need to create the “page” widget as a separate aset Id imagine, and then have some sort of function in the “book” that sets visibility on each “page” to scroll between them instead of simply childing them to scroll-box.

Well good luck, hope you get it working ^^

Got it working by using scrollinto view. Scrolled the next child of the ‘book’ widget into view. Incremented and decremented the ID of the page to get accordingly.
Only let the respective functions run when user wasnt on the first or last page.