Update map_coordinates.md

This commit is contained in:
Josh Freeman
2015-12-02 17:47:19 +00:00
parent c033f46063
commit c3ec746a63
+5 -3
View File
@@ -74,10 +74,12 @@ function mapsTranslateXYZToGame($x, $y, $scale, $tilescale = 50)
And finally, to translate an in game X/Y to a `levels.exd` position which can then be converted to a 2D or Long/Lat: And finally, to translate an in game X/Y to a `levels.exd` position which can then be converted to a 2D or Long/Lat:
```php ```php
function mapsTranslateGameToXYZ($x, $y) function mapsTranslateGameToXYZ($x, $y, $scale)
{ {
$x = ($x*50)-25-1024; $scale = $scale / 100;
$y = ($y*50)-25-1024;
$x = ($x*50)-25-(1024 / $scale);
$y = ($y*50)-25-(1024 / $scale);
return [ return [
'x' => $x, 'x' => $x,