How to make it so that on each scroll the cells are simply updated, and not new ones are drawn?

Question.
I have a GridPanel nested within a ScrollBox. There are several widgets, but the point is that the inventory has cells and it can be scrolled up.

A maximum of 30 cells are displayed, but the total number is unlimited, at least 1kk.

How to make it so that on each scroll the cells are simply updated, and not new ones are drawn?

How to make it so that on each scroll
the cells are simply updated, and not
new ones are drawn?

I didn’t get that bit. :frowning:

but the total number is unlimited, at
least 1kk.

You will hit a performance brick wall & face a bloated memory footprint with those numbers using a Grid Panel. You will need a Tile View instead. Here’s a neat example of how a List View (same idea but not tiled) works:

You only draw / show what the user can see (plus some margin). So if the container can show 30 items at a time but you have 10k elements, only a fraction of those will be kept and managed in the memory and other bits are generated dynamically on-the-fly as needed.


If you decide to stick with the Grid solution, here’s how you can dynamically add and distribute elements a grid:

The forums update messed up some images, but the critical bit shows up.

I can’t decide if it’s a good idea to use TileView for inventory or not? Some people say it is for other things.

For example, how would you organize the UI in an MMO game?

I’m not crazy, it’s just that mmo rpg windows and inventory are very close to my idea.