forums

TNT Basic Forums > Programming Q&A
Mouse on Maps
< Last Thread     Next Thread >
Author
Thread        Post A Reply

02-22-2003 16:46

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

Hi
I've been using the code line

if mouse button and mouse x<500 and mouse x>405 and mouse y<295 and mouse y>275

to simulate a button on the screen. But now I have to make something like this on a scrollable map. How can I get the mouse co-ordinates on the map and not the screen?

Thanks,

02-23-2003 14:54

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Are you using a canvas+viewport or a map viewport ? I think the answer is different in each case.

02-25-2003 14:28

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

Map Viewport

03-01-2003 03:15

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

Actually, I've been looking it over the last few days. There is no way to is there?

03-01-2003 22:38

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

>
if mouse button and mouse x<500 and mouse x>405 and mouse y<295 and mouse y>27
>

will become

>
if mouse button and mouse x+viewPortX<500 and mouse x+viewPortX>405 and mouse y+viewPortY<295 and mouse y+viewPortY>27
>

where viewPortX and viewPortY are the offsets coords of the viewport. I think it'll work ( I didn't try it )

03-02-2003 03:05

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

Actually, I uesd a model of it to get it to work:

mouse x/map tile width + (mapx/map tile width)

where mapx is the x-viewport offset

Thanks anyways matt.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.