Create account / Log in

Mouse coordinates

Topics related to the main Vassal engine.

Moderators: uckelman, Tim M

Mouse coordinates

Postby barbanera » July 27th, 2020, 5:00 pm

Is there any way to find out what the X,Y coordinates of the mouse are when triggering a command on a piece? I mean the coordinates on the given map or even just offsets relative to the given piece.

What I am trying/hoping to do is having a large piece (actually covering the whole map, transparent or otherwise), right clicking on it somewhere to pull up a menu with a command like "place ship here" and actually have it "place marker" a ship at the precise X,Y coordinates where the mouse was.

Unfortunately, CurrentX/CurrentY always refer to the center of the piece... but maybe I am missing something obvious here.

Otherwise - feature request - it would be nice to have MouseX/MouseY (or something such) as global properties in the next update!
barbanera
 
Posts: 395
Joined: January 12th, 2012, 2:27 pm

Re: Mouse coordinates

Postby Cattlesquat » August 3rd, 2020, 7:21 pm

It looks like VASSAL 3.3.3 will have this, so be on the lookout for betas and you can help us try it out and make sure it works well.

You'll simply define Dynamic Properties for ClickedX and ClickedY in the piece you want to know where the right-click was, and it will be automatically filled in.
User avatar
Cattlesquat
 
Posts: 890
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Mouse coordinates

Postby barbanera » August 24th, 2020, 9:59 am

Just read this and I notice there is a 3.3.3 beta1 to test out already, nice!

I have not been following Vassal 4 development at all, but it does appear that development of version 3 has resumed in full swing. Great news!
barbanera
 
Posts: 395
Joined: January 12th, 2012, 2:27 pm

Re: Mouse coordinates

Postby barbanera » August 26th, 2020, 8:55 am

Just a quick note to say that, so far in my testing, ClickedX and ClickedY are working like a charm.
barbanera
 
Posts: 395
Joined: January 12th, 2012, 2:27 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests