Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 793 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mouse Wrap? #317817
04/02/10 19:01
04/02/10 19:01
Joined: Apr 2010
Posts: 38
D
deianthropus Offline OP
Newbie
deianthropus  Offline OP
Newbie
D

Joined: Apr 2010
Posts: 38
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?

Re: Mouse Wrap? [Re: deianthropus] #317920
04/03/10 16:59
04/03/10 16:59
Joined: Apr 2010
Posts: 38
D
deianthropus Offline OP
Newbie
deianthropus  Offline OP
Newbie
D

Joined: Apr 2010
Posts: 38
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.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1