Need a little help with a list layout issue

TL;DR I need to find the true position of a UI element inside a listlayout without using the layoutOrder attribute.

I want a list of UI elements that alternate from a dark grey to a light grey and back (kinda like a spreadsheet).

I connot use a script to change it based on even and odd numbers, because I plan to put the number of players in a matchmaking system in the layout order, as a negative number so the most popular games are on top.

example 13 players = -13 in the layout Order
6 players = -6
2 players = -2

I couldnt find anything in devhub for this… Any suggestions? I want to use this setup because it puts less load on the server, but if I need to I guess I could use a dicctionary or something to calculate the needed positions in the list, and set the colors accordingly. I guess I am looking for a shortcut.

You could loop through each UI in the list and make every other darker/lighter every time a new UI is added to the list.

you can read the position values of each gui object in the list. there should be a set pattern since its on a grid. if its on row 2 the y value will be greater than row 1. if its on column 2 the value will be greater than column 1

1 Like

Smart thinking, thanks a ton!

Use the position and the pattern from it being in a grid. Simple calc on the servers end.

That wouldnt work because the order it is added is at the mercy of when the servers are added to the db. So uou would get servers with all different player counts at different times.