#Selecting middle "item" in scrolling ui

26 messages · Page 1 of 1 (latest)

hollow spear
#

Sup! i would want to make, so that element which is on middle of the scrolling frame, would be highlighed

#

and ofc to change whenever player scrolls in it

mighty wadi
hazy schooner
#

and then highlight the element in your preferred way like colors, or outline etc...

hollow spear
#

if that makes sense

hollow spear
#

idk i i explained well

#

(the things draw in black is the whole scrolling frame)

hazy schooner
#

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

hollow spear
#

yes

hazy schooner
#

this is quite hard

hollow spear
#

so i should just use something else?

#

like basic select ui

#

instead of selecting thro scrolling

mighty wadi
#

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

hollow spear
#

how do i get center of window?

#

i havent worked much with ui's

mighty wadi
hollow spear
#

i see, how to get window's center tho?

mighty wadi
#

window center = absolute position + window size / 2
object center = absolute position + absolute size / 2

hollow spear
#

i litteraly never even used scroll frame