Gamestudio Links
Zorro Links
Newest Posts
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
2 registered members (vicknick, AndrewAMD), 1,292 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Really simple question #261742
04/19/09 20:57
04/19/09 20:57
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
Im trying to make a small game like Warcraft 2. I need help for a really simple thing. How can i get the X,Y points of a mouse click (in world koord). Using MOUSE_POS.X is only for the current "screen" (upper left corner X=0). I need the real world x,y of the mouse click (to sent units there etc).

Edit: Its an sprite based game. My view is on top. Thats why i only need x,y. Just
working with MY.X and MY.Y, MY.Z is a fixed size.

Please help and thanx. smile

Last edited by rayp; 04/19/09 21:23.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Really simple question [Re: rayp] #261752
04/19/09 21:53
04/19/09 21:53
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
my_vector.x = mouse_pos.x;
my_vector.y = mouse_pos.y;
my_vector.z = deep; // means how deep you click in the Level...

vec_for_screen (my_vector,camera);

Now my_vector have the coordinates.

Re: Really simple question [Re: Widi] #261794
04/20/09 09:30
04/20/09 09:30
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
if you want to draw a selection box to, search for stratego2 example in AUM11 wink


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Really simple question [Re: Jaxas] #261843
04/20/09 16:18
04/20/09 16:18
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
Cool! These tips helped alot!

Now the sprite is moving to X,Y. Next thing is a small and simple coll ^^

Last edited by rayp; 04/20/09 18:07.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Really simple question [Re: Widi] #263693
05/01/09 13:38
05/01/09 13:38
Joined: Aug 2007
Posts: 165
Germany
J
jermy Offline
Member
jermy  Offline
Member
J

Joined: Aug 2007
Posts: 165
Germany
Originally Posted By: Widi
my_vector.x = mouse_pos.x;
my_vector.y = mouse_pos.y;
my_vector.z = deep; // means how deep you click in the Level...

vec_for_screen (my_vector,camera);

Now my_vector have the coordinates.



thanks, it also helped me smile


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