29.08.2009, 13:24
Murphy, no. (0, 0, 0) is actually at Blueberry Acres, so what you said is wrong.
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.
Код:
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);