I first thought this would work:
rem Code I cant get to work
if mousey()>screen height() then position mouse mousex(),screen height()
if mousey()<0 then position mouse mousex(),0
if mousex()>screen width() then position mouse screen width(),mousey()
if mousex()<0 then position mouse 0,mousey()
but if you print MouseX() and MouseY() to the screen you will see:
0<MouseX()<Screen Height()
0<MouseY()<Screen Width()
for example for 800x600 this means that MouseX() is a number from 0 to 799 but never <0 or >800.
so i tried this:
if mousey()>screen height()-2 then position mouse mousex(),screen height()-2
if mousey()<1 then position mouse mousex(),1
if mousex()>screen width()-2 then position mouse screen width(),mousey()-2
if mousex()<1 then position mouse 1,mousey()
but as you will see Position Mouse positions the mouse on the whole screen, not the window. So we hawve to add the window position to the values. As you use "set window position 300,300" earlier in the code its really easy. But the new code doesnt work either:
set window on
set window layout 0,0,0
set window position 300,300
sync on : sync rate 0
backdrop on
position mouse screen width()/2, screen height()/2
make object cube 1,10
make matrix 1,25000,25000,150,150
position object 1,0,10,0
do
rem Code I cant get to work
if mousey()>screen height()-2 then position mouse 300+mousex(), 300+screen height()-2
if mousey()<1 then position mouse 300+mousex(), 300+1
if mousex()>screen width()-2 then position mouse 300+screen width(),300+mousey()-2
if mousex()<1 then position mouse 300+1, 300+mousey()
print mousex();"/";mousey()
rem Camera
rotate#=rotate#+(mousemovex()/2)
yrotate object 1,rotate#
x# = object position x(1)
y# = object position y(1)
z# = object position z(1)
ay# = object angle y(1)
ax#=ax#+(mousemovey()/2)
if ax#>-80 and ax#<80 then look#=ax#
ax#=look#
cx# = x#+150*cos(ax#)*sin(ay#)*-1
cy# = y#+150*sin(ax#)
cz# = z#+150*cos(ax#)*cos(ay#)*-1
position camera cx#,cy#,cz#
point camera x#,y#,z#
sync
loop
So... now im stuck too... i hope i gave you some tips... but you'll be best off to make it fullscreen or just position the mouse in the middle of the screen all the time (mouseMoveX/Y will work anyways).