Began adding opening image to game screen
- Note that this is stretched to fit the full size of the boardmaster
parent
eabde5c226
commit
0736ce5867
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
||||
} )();
|
||||
|
|
13
style.css
13
style.css
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue