diff --git a/_server/editor.js b/_server/editor.js index 4e5c516d..cbb4f6d1 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -202,23 +202,23 @@ editor.prototype.drawEventBlock = function () { fg.clearRect(0, 0, 416, 416); for (var i=0;i<13;i++) { for (var j=0;j<13;j++) { - var color=null; + var color=[]; var loc=(i+core.bigmap.offsetX/32)+","+(j+core.bigmap.offsetY/32); if (core.isset(editor.currentFloorData.events[loc])) - color = '#FF0000'; - else if (core.isset(editor.currentFloorData.changeFloor[loc])) - color = '#00FF00'; - else if (core.isset(editor.currentFloorData.afterBattle[loc])) - color = '#FFFF00'; - else if (core.isset(editor.currentFloorData.afterGetItem[loc])) - color = '#00FFFF'; - else if (core.isset(editor.currentFloorData.afterOpenDoor[loc])) - color = '#FF00FF'; - else if (core.isset(editor.currentFloorData.cannotMove[loc])) - color = '#0000FF'; - if (color!=null) { - fg.fillStyle = color; - fg.fillRect(32*i, 32*j+32-8, 8, 8); + color.push('#FF0000'); + if (core.isset(editor.currentFloorData.changeFloor[loc])) + color.push('#00FF00'); + if (core.isset(editor.currentFloorData.afterBattle[loc])) + color.push('#FFFF00'); + if (core.isset(editor.currentFloorData.afterGetItem[loc])) + color.push('#00FFFF'); + if (core.isset(editor.currentFloorData.afterOpenDoor[loc])) + color.push('#FF00FF'); + if (core.isset(editor.currentFloorData.cannotMove[loc])) + color.push('#0000FF'); + for(var kk=0,cc;cc=color[kk];kk++){ + fg.fillStyle = cc; + fg.fillRect(32*i+8*kk, 32*j+32-8, 8, 8); } } } diff --git a/libs/control.js b/libs/control.js index 4a3f2468..b98fd7a1 100644 --- a/libs/control.js +++ b/libs/control.js @@ -986,6 +986,12 @@ control.prototype.setGameCanvasTranslate = function(canvas,x,y){ c.style.webkitTransform='translate('+x+'px,'+y+'px)'; c.style.OTransform='translate('+x+'px,'+y+'px)'; c.style.MozTransform='translate('+x+'px,'+y+'px)'; + if(main.mode==='editor' && editor.isMobile){ + c.style.transform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + c.style.webkitTransform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + c.style.OTransform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + c.style.MozTransform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + } }; ////// 更新视野范围 ////// diff --git a/libs/maps.js b/libs/maps.js index d496a9c7..2e3a9c4f 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -192,6 +192,10 @@ maps.prototype.resizeMap = function(floorId) { core.canvas[cn].canvas.setAttribute("height",cheight); core.canvas[cn].canvas.style.width = cwidth*core.domStyle.scale + "px"; core.canvas[cn].canvas.style.height = cheight*core.domStyle.scale + "px"; + if(main.mode==='editor' && editor.isMobile){ + core.canvas[cn].canvas.style.width = core.bigmap.width*32/416*96 + "vw"; + core.canvas[cn].canvas.style.height = core.bigmap.height*32/416*96 + "vw"; + } }); }