【发布时间】:2019-04-02 18:16:10
【问题描述】:
我有一个game.js,其中渲染了我的 Phaser 游戏中的所有精灵。我还有一个index.html 调用这个脚本来渲染游戏。我想为 game.js 画布上的健康栏添加一个 <div>,但我无法做到,当我尝试时,它只显示在游戏上方或下方。
索引.html:
<div id="game">
<script src="/js/game.js"></script>
<script src="/js/script2.js"></script>
<script src="/js/script3.js"></script>
<script src="/js/script4.js"></script>=
<div id="health-bar">the code of my health bar</div>
</div>
game.js:
var game = new Phaser.Game( 3840, 2176, Phaser.CANVAS , 'game', { preload: preload, create: create, update: update, render:render}, false, true);
【问题讨论】:
标签: javascript html css phaser-framework