bigmap-editor
This commit is contained in:
1 parent
23062fde85
commit
7032cb7c83
3 files changed
+58
-17
No files matched your search
+48
-14
@@ -5,6 +5,11 @@
|
||||
<link href="_server/css/editor.css" rel="stylesheet">
|
||||
<link href="_server/CodeMirror/codemirror.css" rel="stylesheet">
|
||||
<link href="_server/css/editor_mode.css" rel="stylesheet">
|
||||
<style>
|
||||
#mapEdit {
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
@@ -241,7 +246,14 @@
|
||||
<input type="radio" id="brushMod" name="brushMod" value="line" checked="checked" />画线
|
||||
<input type="radio" id="brushMod2" name="brushMod" value="rectangle" />画矩形
|
||||
</span>
|
||||
<br><br><br>
|
||||
<br>
|
||||
<div id="viewportButtons">
|
||||
<input type="button" value="↑"/>
|
||||
<input type="button" value="↓"/>
|
||||
<input type="button" value="←"/>
|
||||
<input type="button" value="→"/>
|
||||
</div>
|
||||
<br>
|
||||
<select id="selectFloor"></select>
|
||||
<input type="button" value="保存地图" id='saveFloor'/>
|
||||
<!-- -->
|
||||
@@ -370,35 +382,38 @@
|
||||
<div id="gif"></div>
|
||||
<div id="gif2"></div>
|
||||
<div id="curtain"></div>
|
||||
<!-- <canvas class='gameCanvas' id='bg' width='416' height='416'></canvas> -->
|
||||
<!-- <canvas class='gameCanvas' id='event' width='416' height='416'></canvas> -->
|
||||
<canvas class='gameCanvas' id='hero' width='416' height='416'></canvas>
|
||||
<!-- <canvas class='gameCanvas' id='event2' width='416' height='416'></canvas> -->
|
||||
<canvas class='gameCanvas' id='fg' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='animate' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='weather' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='ui' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas>
|
||||
<div id="gameDraw">
|
||||
<!-- <canvas class='gameCanvas' id='bg' width='416' height='416'></canvas> -->
|
||||
<!-- <canvas class='gameCanvas' id='event' width='416' height='416'></canvas> -->
|
||||
<canvas class='gameCanvas' id='hero' width='416' height='416'></canvas>
|
||||
<!-- <canvas class='gameCanvas' id='event2' width='416' height='416'></canvas> -->
|
||||
<canvas class='gameCanvas' id='fg' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='animate' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='weather' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='route' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='ui' width='416' height='416'></canvas>
|
||||
<canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas>
|
||||
</div>
|
||||
</div>
|
||||
<!-- */</script> -->
|
||||
<script>
|
||||
// 生成定位编号
|
||||
(function () {
|
||||
buildMark_c3cac94e_bf59_4388_a8e3_a22bac1f4f6a = function (offsetX,offsetY) {
|
||||
var colNum = ' ';
|
||||
for (var i = 0; i < 13; i++) {
|
||||
var tpl = '<td>' + i + '<div class="colBlock" style="left:' + (i * 32 + 1) + 'px;"></div></td>';
|
||||
var tpl = '<td>' + (i+offsetX) + '<div class="colBlock" style="left:' + (i * 32 + 1) + 'px;"></div></td>';
|
||||
colNum += tpl;
|
||||
}
|
||||
arrColMark.innerHTML = '<tr>' + colNum + '</tr>';
|
||||
mapColMark.innerHTML = '<tr>' + colNum + '</tr>';
|
||||
var rowNum = ' ';
|
||||
for (var i = 0; i < 13; i++) {
|
||||
var tpl = '<tr><td>' + i + '<div class="rowBlock" style="top:' + (i * 32 + 1) + 'px;"></div></td></tr>';
|
||||
var tpl = '<tr><td>' + (i+offsetY) + '<div class="rowBlock" style="top:' + (i * 32 + 1) + 'px;"></div></td></tr>';
|
||||
rowNum += tpl;
|
||||
}
|
||||
arrRowMark.innerHTML = rowNum;
|
||||
mapRowMark.innerHTML = rowNum;
|
||||
})();
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- =========================================================== -->
|
||||
@@ -433,6 +448,24 @@ if (location.protocol.indexOf("http")!=0) {
|
||||
</script>
|
||||
<script src='_server/editor.js'></script>
|
||||
<script>
|
||||
editor.buildMark=buildMark_c3cac94e_bf59_4388_a8e3_a22bac1f4f6a;
|
||||
delete(buildMark_c3cac94e_bf59_4388_a8e3_a22bac1f4f6a);
|
||||
editor.moveViewport=function(x,y){
|
||||
core.bigmap.offsetX = core.clamp(core.bigmap.offsetX+32*x, 0, 32*core.bigmap.width-416);
|
||||
core.bigmap.offsetY = core.clamp(core.bigmap.offsetY+32*y, 0, 32*core.bigmap.height-416);
|
||||
core.control.updateViewport()
|
||||
editor.buildMark(core.bigmap.offsetX/32,core.bigmap.offsetY/32);
|
||||
}
|
||||
|
||||
var viewportButtons=document.getElementById('viewportButtons');
|
||||
for(var ii=0,node;node=viewportButtons.children[ii];ii++){
|
||||
(function(x,y){
|
||||
node.onclick=function(){
|
||||
editor.moveViewport(x,y);
|
||||
}
|
||||
})([0,0,-1,1][ii],[-1,1,0,0][ii]);
|
||||
}
|
||||
|
||||
var useCompress = main.useCompress;
|
||||
main.useCompress = false;
|
||||
main.init('editor', function () {
|
||||
@@ -450,6 +483,7 @@ if (location.protocol.indexOf("http")!=0) {
|
||||
editor_blockly = editor_blockly();
|
||||
editor.useCompress = useCompress;
|
||||
delete(useCompress);
|
||||
editor.moveViewport(0,0);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user