I already try to use the transformation available on ETS forum but it is not working as the map he is using is too old.
there is the code I try
Code: Select all
const EU = {
x: 24864.00284,
y: 41034.36648
}
const UK = {
x: 10226,
y: 9826
}
// Based on http://forum.scssoft.com/viewtopic.php?f=41&t=186779
function calculatePixelCoordinate(x, y, pointsPerPixel, x0, y0) {
return [
(x / pointsPerPixel + x0) | 0,
(y / pointsPerPixel + y0) | 0
];
}
function calculatePixelCoordinateEu(x, y) {
return calculatePixelCoordinate(x, y, 7.278, EU.x, EU.y);
}
function calculatePixelCoordinateUk(x, y) {
return calculatePixelCoordinate(x, y, 9.69522, UK.x, UK.y);
}
function game_coord_to_pixels(x, y) {
// http://forum.scssoft.com/viewtopic.php?p=402836#p402836
if (x < -31812 && y < -5618) {
return calculatePixelCoordinateUk(x, y);
} else {
return calculatePixelCoordinateEu(x, y);
}
}