Browse Source

position correctly

master
parent
commit
0d622e63f2
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      00130.платформы.js

+ 6
- 1
00130.платформы.js View File

@@ -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.


Loading…
Cancel
Save