1
0
Fork 0

Began adding opening image to game screen

- Note that this is stretched to fit the full size of the board
master
Mike Gerwitz 2012-03-21 22:44:44 -04:00
parent eabde5c226
commit 0736ce5867
4 changed files with 27 additions and 2 deletions

BIN
images/opening.gif 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="game">
<div id="game" class="game opening">
<ul class="menu">
<li>Game</li>
<li>Move</li>
@ -14,6 +14,7 @@
<li>Help</li>
</ul>
<img id="opening" class="opening" src="images/opening.gif" />
<canvas id="render" width="512" height="512">
Your web browser does not support the canvas element.
</canvas>

View File

@ -23,7 +23,8 @@
var load_ltg = ltjs.FileLoader( document.getElementById( 'ltg' ) ),
load_lvl = ltjs.FileLoader( document.getElementById( 'lvl' ) ),
ctx = document.getElementById( 'render' ).getContext( '2d' ),
game = document.getElementById( 'game' ),
ctx = document.getElementById( 'render' ).getContext( '2d' ),
ltg_loader = ltjs.LtgLoader(),
masker = ltjs.TileMasker( ltjs.ClassicTileDfn() ),
@ -58,6 +59,9 @@ function gamechk()
{
if ( !( tile_set && map_set ) ) return;
// temporary
if ( game.className.search( 'opening' ) > -1 ) return;
// clear any existing locks before rendering (allowing the user to change
// tile sets and map sets)
render && render.freeCanvas();
@ -66,4 +70,11 @@ function gamechk()
render.render( map_set.getMapByNumber( 1 ) );
}
// temporary
document.getElementById( 'opening' ).onclick = function()
{
game.className = game.className.replace( ' opening', '' );
gamechk();
};
} )();

View File

@ -38,12 +38,25 @@ body {
margin: 0px;
}
.game img.opening {
display: none;
width: 512px;
height: 512px;
}
.game.opening img.opening {
display: inline-block;
}
/* 16x16 board */
.game canvas {
width: 512px;
height: 512px;
border: 2px inset gray;
}
.game.opening canvas {
display: none;
}
.game .hud {
position: absolute;