Skip to content

Commit

Permalink
Try preloading font
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Jul 5, 2015
1 parent 0fefe46 commit e7914f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
body{
margin: 0;
padding: 0;
font-family: VT323;
font-family: VT323, monospace;
}
</style>
<script src="scripts/phaser.min.js"></script>
Expand All @@ -29,9 +29,9 @@
<script src="scripts/preload.js"></script>
<script src="scripts/boot.js"></script>
</head>
<body>
<div id="fontloader" style="display: none">Foobar</div>
<body
<div id="gameContainer"></div>
<div id="fontLoader">Drunken Viking</div>
<script src="scripts/index.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
window.onload = function() {
window.onload = function() { setTimeout(function () {
document.getElementById('fontLoader').style.display = 'none';
var game = new Phaser.Game(SCREEN_WIDTH, SCREEN_HEIGHT, Phaser.AUTO,
'gameContainer', null, false,
false);
game.state.add('boot', BasicGame.Boot);
game.state.add('preload', BasicGame.Preload);
game.state.add('game', GameState);
game.state.start('boot');
};
}, 1000); };

0 comments on commit e7914f9

Please sign in to comment.