У меня есть вот такой код, но он немножко не так работает, есть ли еще какой то вариант изменения расположения?Конкретно к мини карте привязать расположение не получится. Нужно делать адаптивную верстку с отступами в процентном соотношении
Тебе нужно получить разрешение экрана игрока а потому уже применять процентное соотношениеУ меня есть вот такой код, но он немножко не так работает, есть ли еще какой то вариант изменения расположения?
#bottom-left {
position: fixed;
bottom: 10%;
left: 21%
text-align: left;
}
вот так оно выглядит при 16:9
Посмотреть вложение 18264
а вот так при 5:4
Посмотреть вложение 18266
Конечно есть, нашел в офф канале дискорда RAGE MPУ меня есть вот такой код, но он немножко не так работает, есть ли еще какой то вариант изменения расположения?
#bottom-left {
position: fixed;
bottom: 10%;
left: 21%
text-align: left;
}
вот так оно выглядит при 16:9
Посмотреть вложение 18264
а вот так при 5:4
Посмотреть вложение 18266
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;
}
спасибо!Конечно есть, нашел в офф канале дискорда RAGE MP
Код: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; }