Geting center position of gtasa map
#4

Murphy, no. (0, 0, 0) is actually at Blueberry Acres, so what you said is wrong.

Код:
iImagePosX = (eClick.offsetX ? eClick.offsetX : eClick.pageX - eElement.offsetLeft);
iImagePosY = (eClick.offsetY ? eClick.offsetY : eClick.pageY - eElement.offsetTop);
iRelativeX = Math.round(((iImagePosX / iImageWidth) * 6000) - 3000);
iRelativeY = Math.round((6000 - (iImagePosY / iImageHeight) * 6000) - 3000);
This is what I use in Javascript to get the GTA:SA relative location. Note that if your image is smaller than 6000 pixels, then you'll have to take that into consideration.
Reply


Messages In This Thread
Geting center position of gtasa map - by StrickenKid - 29.08.2009, 04:08
Re: Geting center position of gtasa map - by XPlatform - 29.08.2009, 06:22
Re: Geting center position of gtasa map - by [MM]Murphy - 29.08.2009, 12:37
Re: Geting center position of gtasa map - by Westie - 29.08.2009, 13:24
Re: Geting center position of gtasa map - by StrickenKid - 29.08.2009, 15:33
Re: Geting center position of gtasa map - by StrickenKid - 30.08.2009, 04:15
Re: Geting center position of gtasa map - by Westie - 30.08.2009, 08:36
Re: Geting center position of gtasa map - by StrickenKid - 30.08.2009, 14:47
Re: Geting center position of gtasa map - by StrickenKid - 30.08.2009, 15:16
Re: Geting center position of gtasa map - by Redirect Left - 30.08.2009, 23:22

Forum Jump:


Users browsing this thread: 1 Guest(s)