reconfigure HUD positioning and add a test element to the HUD
This commit is contained in:
18
css/game.css
18
css/game.css
@ -1,6 +1,6 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -10,13 +10,6 @@ body:hover {
|
|||||||
canvas.main_canvas {
|
canvas.main_canvas {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
.hud {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
.hud_item {
|
.hud_item {
|
||||||
background-color: #555555aa;
|
background-color: #555555aa;
|
||||||
margin: 8px;
|
margin: 8px;
|
||||||
@ -24,6 +17,15 @@ canvas.main_canvas {
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: white;
|
color: white;
|
||||||
font-family: roboto, sans-serif;
|
font-family: roboto, sans-serif;
|
||||||
|
width: fit-content;
|
||||||
|
position: absolute;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.hud_item.bottom {
|
||||||
|
bottom: 0px;
|
||||||
|
}
|
||||||
|
.hud_item.right {
|
||||||
|
right: 0px;
|
||||||
}
|
}
|
||||||
div.bar {
|
div.bar {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<canvas id="main_canvas" class="main_canvas" width="700" height="700" autofocus></canvas>
|
<canvas id="main_canvas" class="main_canvas" width="700" height="700" autofocus></canvas>
|
||||||
<div class="hud">
|
|
||||||
<div class="hud_item">
|
<div class="hud_item">
|
||||||
<div class="bar red_bar">
|
<div class="bar red_bar">
|
||||||
<div id="health_bar"></div>
|
<div id="health_bar"></div>
|
||||||
@ -17,7 +16,9 @@
|
|||||||
<div id="energy_bar"></div>
|
<div id="energy_bar"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hud_item" id="player_username">Runic alpha</div>
|
<div class="hud_item right" id="player_username">Runic alpha</div>
|
||||||
|
<div class="hud_item bottom right">
|
||||||
|
this is a test
|
||||||
</div>
|
</div>
|
||||||
<script src="script/engine.js"></script>
|
<script src="script/engine.js"></script>
|
||||||
<script src="script/client.js"></script>
|
<script src="script/client.js"></script>
|
||||||
|
Reference in New Issue
Block a user