#Selecting middle "item" in scrolling ui
26 messages · Page 1 of 1 (latest)
How well do you know vector math?
you could access and iterate on all the elements, and then check if the elements are an odd number, and then i guess divide the elements by 2 to get the middle element in some way?
and then highlight the element in your preferred way like colors, or outline etc...
i never really worked with scroll ui's
and i want the middle element to be highlighted, but not of whole frame, just of the part that players is currently viewing
if that makes sense
good question!
idk i i explained well
(the things draw in black is the whole scrolling frame)
i see
so you want the middle element to be highlighted based off what the player is seeing in the scroll ui, once he scrolls, the middle element changes and stays in the middle
yes
this is quite hard
so i should just use something else?
like basic select ui
instead of selecting thro scrolling
It's simple vector math, so I suppose I got my answer
The middle object is the object with a center which is closest to the center of the window
i see, how to get window's center tho?
window center = absolute position + window size / 2
object center = absolute position + absolute size / 2
i litteraly never even used scroll frame