Przeglądaj źródła

position correctly

master
rodzic
commit
0d622e63f2
1 zmienionych plików z 6 dodań i 1 usunięć
  1. +6
    -1
      00130.платформы.js

+ 6
- 1
00130.платформы.js Wyświetl plik

@@ -20,8 +20,12 @@
continue;
}
var div = мир.платформы.div[имя];
/*
let x = тело.bounds.min.x;
let y = тело.bounds.min.y;
*/
let x = тело.position.x - div.offsetWidth / 2;
let y = тело.position.y - div.offsetHeight / 2;
let угол = тело.angle * (180 / Math.PI);
div.style.transform = `translate(${x}px, ${y}px) rotate(${угол}deg)`;
/*
@@ -102,7 +106,8 @@ console.debug("создать тело", тело);
document.body.appendChild(элемент);
мир.платформы.div[имя] = элемент;

элемент.style.transformOrigin = `right bottom`;
//элемент.style.transformOrigin = `right bottom`;
элемент.style.transformOrigin = `center`;
}

// Обновить div.


Ładowanie…
Anuluj
Zapisz