function INI_ControlCameraWithMouse(cam_num,mouse_lock)
mx#=mousemoveX()
my#=mousemoveY()
mz#=mousemoveZ()
if mouse_lock=1
yrotate camera camera angle y(cam_num)+mx#
xrotate camera camera angle x(cam_num)+my#
endif
cx#=camera position x(cam_num)
cy#=camera position y(cam_num)
cz#=camera position z(cam_num)
position camera cam_num,cx#,cy#+(mz#*.1),cz#
if mouse_lock=1
position mouse screen width()/2,screen height()/2
if mouseclick()=1
move camera cam_num,1
endif
endif
if mouseclick()=2
select mouse_lock
case 0: mouse_lock=1: endcase
case 1: mouse_lock=0: endcase
endselect
nice wait no mouse
endif
endfunction
- Infinity is Simplicity -