function getMinimapAnchor() {
let sfX = 1.0 / 20.0;
let sfY = 1.0 / 20.0;
let safeZone = mp.game.graphics.getSafeZoneSize();
let aspectRatio = mp.game.graphics.getScreenAspectRatio(false);
let resolution = mp.game.graphics.getScreenActiveResolution(0, 0);
let scaleX = 1.0 / resolution.x;
let scaleY = 1.0 / resolution.y;
``
const minimap = {
width: scaleX * (resolution.x / (4 * aspectRatio)),
height: scaleY * (resolution.y / 5.674),
scaleX: scaleX,
scaleY: scaleY,
leftX: scaleX * (resolution.x * (sfX * (Math.abs(safeZone - 1.0) * 10))),
bottomY: 1.0 - scaleY * (resolution.y * (sfY * (Math.abs(safeZone - 1.0) * 10))),
};
minimap.rightX = minimap.leftX + minimap.width;
minimap.topY = minimap.bottomY - minimap.height;
// You will need to keep track of BIG_MAP toggle yourself
// Make sure to change this variable in bigmap keybind
if (BIG_MAP) {
// CREDITS TO: kseny
minimap.width += minimap.width / 2;
if ((2.33 <= aspectRatio && aspectRatio <= 2.34) || (2.63 <= aspectRatio && aspectRatio <= 2.67))
minimap.width += 0.0104;
else
minimap.width += 0.0052;
const oldHeight = minimap.height;
minimap.height += minimap.height * 2.4;
minimap.height -= oldHeight;
if ((2.33 <= aspectRatio && aspectRatio <= 2.34) || (2.63 <= aspectRatio && aspectRatio <= 2.67))
minimap.height += 0.0104;
else
minimap.height += 0.0052;
}
return minimap;
}