277 lines
No EOL
5.2 KiB
HTML
277 lines
No EOL
5.2 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
|
|
<title>Level Editor - Tile Game</title>
|
|
|
|
<!--Scripts-->
|
|
<script src="code/external/jquery.js"></script>
|
|
<script src="code/files.js"></script>
|
|
<script src="code/tileengine.js"></script>
|
|
<script src="code/level.js"></script>
|
|
<script src="code/tileset.js"></script>
|
|
<script src="code/tile.js"></script>
|
|
<script src="code/leveleditor/main.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
onDOMLoaded();
|
|
});
|
|
</script>
|
|
<!--Scripts End-->
|
|
|
|
<!--Styles-->
|
|
<style type="text/css">
|
|
body {
|
|
background: rgb(80, 80, 80);
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
#container {
|
|
position: absolute;
|
|
width: 800px;
|
|
height: 512px;
|
|
border: 1px solid black;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
margin: auto;
|
|
background: white;
|
|
}
|
|
|
|
#tiles {
|
|
position: absolute;
|
|
width: 512px;
|
|
height: 512px;
|
|
background: red;
|
|
}
|
|
|
|
#panel {
|
|
position: absolute;
|
|
border-left: 1px solid black;
|
|
border-bottom: 1px solid black;
|
|
width: calc(800px - 512px);
|
|
height: 300px;
|
|
left: 512px;
|
|
}
|
|
|
|
#tileset {
|
|
position: absolute;
|
|
width: calc(800px - 513px);
|
|
height: 211px;
|
|
top: 300px;
|
|
border-left: 1px solid black;
|
|
border: 1px solid black;
|
|
left: 512px;
|
|
overflow-x: scroll;
|
|
overflow-y: scroll;
|
|
}
|
|
|
|
.highlight {
|
|
position: absolute;
|
|
background: rgba(255, 255, 0, 0.5);
|
|
z-index: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
#highlight_tiles {
|
|
width: 26px;
|
|
height: 26px;
|
|
}
|
|
|
|
#highlight_tileset {
|
|
width: 26px;
|
|
height: 26px;
|
|
}
|
|
|
|
#infocontainer {
|
|
margin-top: 5px;
|
|
margin-left: 5px;
|
|
width: 274px;
|
|
font-family: Arial;
|
|
font-size: 14px;
|
|
}
|
|
|
|
#infocontainer h3 {
|
|
padding: 0;
|
|
margin: 0;
|
|
margin-bottom: 5px;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
#overlay {
|
|
position: fixed;
|
|
width: 100%;
|
|
height: 100%;
|
|
z-index: 10000;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
margin: 0;
|
|
padding: 0;
|
|
display: none;
|
|
}
|
|
|
|
.dialog {
|
|
position: absolute;
|
|
border: 1px solid black;
|
|
background: white;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
margin: auto;
|
|
font-family: Arial;
|
|
}
|
|
|
|
#dialog_save {
|
|
width: 250px;
|
|
height: 150px;
|
|
display: none;
|
|
}
|
|
|
|
#dialog_save p {
|
|
padding: 0;
|
|
margin: 0;
|
|
width: 150px;
|
|
margin: 0 auto;
|
|
margin-top: 15px;
|
|
text-align: center;
|
|
font-family: Arial;
|
|
font-size: 14px;
|
|
}
|
|
|
|
#dialog_save_levelname {
|
|
position: absolute;
|
|
width: 150px;
|
|
border: 1px solid black;
|
|
background: rgb(240, 240, 240);
|
|
left: 0;
|
|
right: 0;
|
|
margin: 0 auto;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
#dialog_save_savelevel {
|
|
width: 100px;
|
|
margin: 0 auto;
|
|
position: absolute;
|
|
margin-top: 50px;
|
|
font-size: 14px;
|
|
font-family: Arial;
|
|
left: 0;
|
|
right: 0;
|
|
}
|
|
|
|
#dialog_tilesets {
|
|
width: 225px;
|
|
height: 250px;
|
|
display: none;
|
|
}
|
|
|
|
#dialog_tilesets h3 {
|
|
padding: 0;
|
|
margin: 0 auto;
|
|
margin-top: 15px;
|
|
text-align: center;
|
|
left: 0;
|
|
right: 0;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
#dialog_tilesets_list {
|
|
margin: 0 auto;
|
|
width: 200px;
|
|
height: 190px;
|
|
margin-top: 10px;
|
|
overflow-y: scroll;
|
|
font-size: 14px;
|
|
}
|
|
|
|
#dialog_levels {
|
|
width: 225px;
|
|
height: 250px;
|
|
display: none;
|
|
}
|
|
|
|
#dialog_levels h3 {
|
|
padding: 0;
|
|
margin: 0 auto;
|
|
margin-top: 15px;
|
|
text-align: center;
|
|
left: 0;
|
|
right: 0;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
#dialog_levels_list {
|
|
margin: 0 auto;
|
|
width: 200px;
|
|
height: 190px;
|
|
margin-top: 10px;
|
|
overflow-y: scroll;
|
|
font-size: 14px;
|
|
}
|
|
|
|
</style>
|
|
<!--Styles End-->
|
|
</head>
|
|
<body>
|
|
<div id="overlay">
|
|
<div id="dialog_save" class="dialog">
|
|
<p>
|
|
Please provide a name for your level file so
|
|
it can be saved.
|
|
</p>
|
|
|
|
<input type="text" id="dialog_save_levelname" />
|
|
<button id="dialog_save_savelevel" onclick="saveLevel(); return;">Save Level</button>
|
|
</div>
|
|
|
|
<div id="dialog_tilesets" class="dialog">
|
|
<h3>Tilesets</h3>
|
|
|
|
<div id="dialog_tilesets_list"></div>
|
|
</div>
|
|
|
|
<div id="dialog_levels" class="dialog">
|
|
<h3>levels</h3>
|
|
|
|
<div id="dialog_levels_list"></div>
|
|
</div>
|
|
</div>
|
|
<div id="container">
|
|
<div id="tiles">
|
|
<div id="highlight_tiles" class="highlight"></div>
|
|
<canvas id="tiles_canvas"></canvas>
|
|
</div>
|
|
<div id="panel">
|
|
<div id="infocontainer">
|
|
<h3>Level</h3>
|
|
<b>Tile ID:</b> <span id="info_tileid"></span><br>
|
|
<b>Grid Pos:</b> <span id="info_gridpos"></span><br>
|
|
<b>Mouse Pos:</b> <span id="info_mousepos"></span><br>
|
|
<br>
|
|
<h3>Tileset</h3>
|
|
<b>Tile ID:</b> <span id="info_ts_tileid"></span><br>
|
|
<b>Grid Pos:</b> <span id="info_ts_gridpos"></span></br>
|
|
<b>Mouse Pos: </b> <span id="info_ts_mousepos"></span>
|
|
<br>
|
|
<br>
|
|
<h3>Actions</h3>
|
|
<a href="#" onclick="openSaveDialog(); return;">Save Level</a><br>
|
|
<a href="#" onclick="loadLevelDialog(); return;">Load Level</a><br>
|
|
<a href="#" onclick="clearTiles(); return;">Clear Tiles</a><br>
|
|
<a href="#" onclick="openTilesetDialog(); return;">Load Tileset</a>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="tileset">
|
|
<div id="highlight_tileset" class="highlight"></div>
|
|
<img id="tileset_image"></img>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |