Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 953 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
getting mouse/crosshair in the middle of the screen #408693
10/05/12 20:03
10/05/12 20:03
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
Hi,

this is a very simple problem, but I dont know, why this code doesnt work. I am trying to get the crosshair in the middle of the screen, and I use mouse_mode = 1. This is my code:

mouse_pos.x = screen_size.x/2;
mouse_pos.x = screen_size.y/2;

But the mouse stays on top of the gamewindow, not even in the middle. What did I wrong?

EDIT:
What I need is the mousecursor to stay in the middle, so that I am able to click on entites. I think this should be easy, but somehow, there exists no such mouse_mode or something like this.

Thanks

Last edited by gameplan; 10/05/12 20:21.

Version: A8 free
OS: Windows 10
Re: getting mouse/crosshair in the middle of the screen [Re: gameplan] #408694
10/05/12 20:05
10/05/12 20:05
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Don't use the mouse, use a panel instead (if you are in fact trying to realize a crosshair).
If you are really trying to change the mouse position, I think you have to use the Windows function "SetCursorPos".


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: getting mouse/crosshair in the middle of the screen [Re: Superku] #408696
10/05/12 20:10
10/05/12 20:10
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
A panel wont work, because I need to click with this pointer on entities.
EDIT:
How do I use SetCursorPos, it is not explained in the manual?

Last edited by gameplan; 10/05/12 20:14.

Version: A8 free
OS: Windows 10
Re: getting mouse/crosshair in the middle of the screen [Re: gameplan] #408700
10/05/12 20:47
10/05/12 20:47
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Why don't you just use c_trace instead?
Use the forum search for SetCursorPos.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: getting mouse/crosshair in the middle of the screen [Re: Superku] #408701
10/05/12 20:50
10/05/12 20:50
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
Ha, now it works. Thank you for your help. There was just a problem with "screen_size".


Version: A8 free
OS: Windows 10

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