@ Buggy,
Using 3d is much better for you here. Just use mousexspeed and mouseyspeed scaled by some factor and then movemouse to the middle of the viewport each frame.
Works well for me anyway.
Alternatively, here's a bit of code to for a 2d-in-3d GUI which works in all resolutions - you'll need your own cursor texture.
Graphics3D 640,480,16,1
AmbientLight 255,255,255
Global CAMERA = CreateCamera() , LIGHT = CreateLight()
Global GH = GraphicsHeight()
Global GW = GraphicsWidth()
Global HGW = GW * .5
Global HGH = GH * .5
Global GUIcamera
Global GUIcursor
Global GUIsx#, GUIsy#
;draw some backgound stuff
For l = 0 To 50
entity = CreateCube()
ScaleEntity entity , Rand(1,5), Rand(1,5), Rand(1,5 )
RotateEntity entity , 0, Rand(-180,180 ), 0
EntityColor entity, Rand( 128,255 ), Rand( 128,255 ), Rand( 128,255 )
PositionEntity entity, Rand(-100,100 ), Rand(-100,100 ), Rand(-100,100 )
Next
GUI_Init()
While Not KeyDown(1)
TurnEntity CAMERA, 1, 1, 0
GUI_Position( GUIcursor , MouseX(), MouseY() )
RenderWorld()
Flip
Wend
;===========================================================================
;===========================================================================
;===========================================================================
Function GUI_Init()
GUIcamera = CreateCamera()
CameraClsMode GUIcamera,False,True
CameraRange GUIcamera, .1,5
PositionEntity GUIcamera, 0,0,10000
EntityOrder GUIcamera,-999
;get 3d reso independant scaling
GUIplane = CreatePlane( 1, GUIcamera )
RotateEntity GUIplane, -90,0,0
PositionEntity GUIplane, 0,0,1
EntityPickMode GUIplane, 2
CameraPick ( GUIcamera, 0,0 )
sx# = PickedX()
sy# = PickedY()
CameraPick ( GUIcamera, 1, 1 )
GUIsx# = PickedX() - sx
GUIsy# = sy - PickedY()
FreeEntity GUIplane
;cursor
GUIcursor = GUI_Quad( GUIcamera, 16 , 16 , LoadTexture( "Cursor.png", 4 ) , True , 0 , 0 , 1, -1000 )
End Function
;===========================================================================
;===========================================================================
;===========================================================================
Function GUI_Position( Entity , x#, y# )
PositionEntity Entity, ( x - HGW ) * GUIsx , ( HGH - y ) * GUIsy, 0
End Function
;===========================================================================
;===========================================================================
;===========================================================================
Function GUI_Quad( parent , sx#, sy#, Texture , Free = False , ox#=0, oy#=0 , oz# = 1 , order=-998 )
mesh = CreateMesh( parent )
s = CreateSurface( mesh )
For iy = 0 To 1
For ix = 0 To 1
px# = ( ix * sx - ox ) * GUIsx
py# = ( -iy * sy + oy ) * GUIsy
AddVertex s, px, py, oz, ix+.5*(1.0/sx), iy+.5*(1.0/sy )
Next
Next
AddTriangle s, 0,1,3
AddTriangle s, 3,2,0
EntityFX mesh, 1
EntityTexture mesh , Texture
If Free FreeTexture Texture
EntityOrder mesh, order
Return mesh
End Function
Stevie