Mouse Wrap?

Posted By: deianthropus

Mouse Wrap? - 04/02/10 19:01

Hello, I am relatively new to 3dGS but have experience in other languages. I have created a view system that rotates about an object based on the mouse x and y position, but now I want to make the mouse wrap so you can circle about the object continuously.

I have tried setting ( vec_set() ) mouse_pos and mouse_cursor individually and together, and it will set the value i need in each case, but the limit of motion still exists in the same direction as originally (if you are crossing the screen boundary going left, the mouse/cursor value will jump to the pixel value at the opposite end, but I cannot continue moving the mouse left).

What can I do? I am checking for mouse force

(if (mouse_pos.x == 0 && mouse_force.x <= -1) )

setting the value of a vector, and applying it to the mouse and cursor positions.

newmouse=vector(screen_width-1,mouse_pos.y,0);vec_set(mouse_pos,newmouse);

I have also tried vec_add, and it did not work. How can I wrap the mouse around the x axis?
Posted By: deianthropus

Re: Mouse Wrap? - 04/03/10 16:59

Figured it out, kinda. I worked around it, really, by creating a virtual_mouse vector that was not set by mouse_pos or mouse_cursor but had an arbitrary starting point (midscreen) and was altered by mickey virtual_mouse.x += mickey.x Simple, effective and kinda beautiful. Gotta love mickey.
© 2024 lite-C Forums