8000 fix indeterminate loading bar; can upgrade at later stage · GameJs/gamejs@b8b0d56 · GitHub
[go: up one dir, main page]

Skip to content

Commit b8b0d56

Browse files
committed
fix indeterminate loading bar; can upgrade at later stage
1 parent 452ab90 commit b8b0d56

File tree

11 files changed

+95
-21
lines changed

11 files changed

+95
-21
lines changed

examples/collisionmask/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/draw/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/event/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/minimal/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/noise/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/skeleton/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/thread/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/threaded-noise/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/tmxmap/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

examples/touch/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
box-shadow: 14px 10px 30px 0px rgba(50, 50, 50, 0.75);
1515
width: calc(100% - 40px);
1616
height: calc(100% - 60px);
17-
position: absolute
17+
position: absolute;
18+
/** automatically made visible once game is loaded **/
19+
display:none;
1820
}
1921
.footer {
2022
position:absolute;
2123
top: calc(100% - 50px);
2224
}
25+
#gjs-loader {
26+
height: 100%;
27+
padding: 10% 0% 0% 30%;
28+
}
2329
</style>
2430
<script src="../../gamejs-2.0.0-alpha.js"></script>
2531
<script>
@@ -30,7 +36,8 @@
3036
<body>
3137
<div>
3238
<div id="gjs-loader">
33-
Loading...
39+
<progress max=1 min=0 steps=0.1></progress>
40+
<br/>Loading...
3441
</div>
3542
<canvas id="gjs-canvas"></canvas>
3643
<p class="footer">

src/gamejs/display.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,14 @@ exports.init = function() {
163163
canvas.focus();
164164
}
165165
// remove loader if any;
166-
var $loader = document.getElementById('gjs-loader');
166+
var $loader = document.getElementById(LOADER_ID);
167167
if ($loader) {
168168
$loader.style.display = "none";
169169
}
170+
var $displaySurface = document.getElementById(CANVAS_ID);
171+
if ($displaySurface) {
172+
$displaySurface.style.display = 'block';
173+
}
170174
// hook into resize
171175
window.addEventListener("resize", onResize, false);
172176
return;

0 commit comments

Comments
 (0)
0