Created
May 20, 2013 06:06
-
-
Save louisstow/5610652 to your computer and use it in GitHub Desktop.
Example of a game with 3 canvas layers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="stage"> | |
<canvas id="ui-layer" width="480" height="320"></canvas> | |
<canvas id="game-layer" width="480" height="320"></canvas> | |
<canvas id="background-layer" width="480" height="320"></canvas> | |
</div> | |
<style> | |
#stage { | |
width: 480px; | |
height: 320px; | |
position: relative; | |
border: 2px solid black | |
} | |
canvas { position: absolute; } | |
#ui-layer { z-index: 3 } | |
#game-layer { z-index: 2 } | |
#background-layer { z-index: 1 } | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment