Yea, that would work fine.
I guess what I'm really asking though, is if there is a way to not have to loop through twice? Once to check for dragging, and once to draw the images in the right order, since I need to draw them from back to front, yet check them from front to back.
The only thing I've thought of is making an array of types that I can sort through like (pseudocode):
for loop = i to count
check if dragging object(count-i)
draw image object(i)
next
but that is not very good since the number of objects will be changing a lot.
or is looping through twice simply the way to do it?
I guess what I'm really asking though, is if there is a way to not have to loop through twice? Once to check for dragging, and once to draw the images in the right order, since I need to draw them from back to front, yet check them from front to back.
The only thing I've thought of is making an array of types that I can sort through like (pseudocode):
for loop = i to count
check if dragging object(count-i)
draw image object(i)
next
but that is not very good since the number of objects will be changing a lot.
or is looping through twice simply the way to do it?