transform fuck up pixels?
This commit is contained in:
parent
a7dd5d281f
commit
83c34d496e
2 changed files with 5 additions and 7 deletions
|
@ -5,21 +5,17 @@
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
* {
|
* {
|
||||||
font-size: 2em;
|
font-size: 50px;
|
||||||
color: #ff00ff;
|
color: #ff00ff;
|
||||||
font-family: helvetica, arial;
|
font-family: helvetica, arial;
|
||||||
}
|
}
|
||||||
#player {
|
#player {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10%;
|
bottom: 10%;
|
||||||
-webkit-transform: rotate(90deg);
|
|
||||||
-moz-transform: rotate(90deg);
|
|
||||||
}
|
}
|
||||||
#enemy {
|
#enemy {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10%;
|
top: 10%;
|
||||||
-webkit-transform: rotate(90deg);
|
|
||||||
-moz-transform: rotate(90deg);
|
|
||||||
}
|
}
|
||||||
#pewpew {
|
#pewpew {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
|
|
|
@ -74,7 +74,8 @@ function render() {
|
||||||
body.appendChild(shootdiv);
|
body.appendChild(shootdiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
shootdiv.style.left = shoots[i][0];
|
shootdiv.style.left = (shoots[i][0]
|
||||||
|
- Math.round(shootdiv.getClientRects()[0].width/2)) + 'px';
|
||||||
shootdiv.style.top = shoots[i][1];
|
shootdiv.style.top = shoots[i][1];
|
||||||
if (debug)
|
if (debug)
|
||||||
shootdiv.style.border = "1px solid";
|
shootdiv.style.border = "1px solid";
|
||||||
|
@ -96,7 +97,8 @@ function render() {
|
||||||
|
|
||||||
// render player
|
// render player
|
||||||
var playerdiv = document.getElementById("player");
|
var playerdiv = document.getElementById("player");
|
||||||
playerdiv.style.left = player_pos[0];
|
playerdiv.style.left = (player_pos[0]
|
||||||
|
- Math.round(playerdiv.getClientRects()[0].width/2)) + 'px';
|
||||||
// FIXME playerdiv.style.top = player_pos[1];
|
// FIXME playerdiv.style.top = player_pos[1];
|
||||||
if (debug)
|
if (debug)
|
||||||
playerdiv.style.border = "1px solid";
|
playerdiv.style.border = "1px solid";
|
||||||
|
|
Reference in a new issue