Skip to content

Commit

Permalink
center the game
Browse files Browse the repository at this point in the history
  • Loading branch information
leudz committed Jan 30, 2021
1 parent 6b43ad6 commit 5818654
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions square_eater/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
html,
body,
canvas {
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background: black;
z-index: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 640px;
height: 360px;
}
</style>
</head>
Expand Down
2 changes: 1 addition & 1 deletion square_eater/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async fn main() {
draw_text(
"Click to start",
WIDTH as f32 / 2. - text_dimensions.0 / 2.,
HEIGHT as f32 / 2.,
HEIGHT as f32 / 2. - text_dimensions.1 / 2.,
40.,
WHITE,
);
Expand Down

0 comments on commit 5818654

Please sign in to comment.