Hello everyone,
My program has 3d objects that I want to be able to select with a mouse click. Everything works great, but it not only selects the object under the mouse cursor, but also all other objects behind the object I wish to select...
Here is the code I'm using. Any help is much appreciated!
// Object Update
function object_update()
total_count = array count(object(0))
for ID = 1 to total_count
// If there is no properties window opened
if getgadgetvisible (object_properties_win) = 0
// Select/Deselect
if mouseclick() = 1
if pick object(mousex(), mousey(), 1, ID) = ID
if object(ID).selected = 0
object(ID).selected = 1
set object wireframe object(ID).mesh, 1
// If 'Ctrl' is pressed
if keystate (29) = 1 and keystate (157) = 1
object(ID).selected = 0
set object wireframe object(ID).mesh, 0
endif
endif
else
// If 'Shift' is NOT pressed
if keystate (42) = 0 and keystate (54) = 0
object(ID).selected = 0
set object wireframe object(ID).mesh, 0
endif
endif
endif
endif
next ID
endfunction
Thanks ahead!
Regards,
Sph!nx