48 in bg/fg

This commit is contained in:
oc 2019-02-20 21:30:30 +08:00
parent 15c889146d
commit f98c85442f
2 changed files with 20 additions and 19 deletions

View File

@ -797,9 +797,6 @@ editor.prototype.listen = function () {
currDrawData.info = JSON.parse(JSON.stringify(editor.info)); currDrawData.info = JSON.parse(JSON.stringify(editor.info));
reDo = null; reDo = null;
// console.log(stepPostfix); // console.log(stepPostfix);
if (editor.layerMod!='map' && editor.info.images && editor.info.images.indexOf('48')!==-1){
printe('前景/背景不支持48的图块');
} else {
if(editor.brushMod==='tileset' && core.tilesets.indexOf(editor.info.images)!==-1){ if(editor.brushMod==='tileset' && core.tilesets.indexOf(editor.info.images)!==-1){
var imgWidth=~~(core.material.images.tilesets[editor.info.images].width/32); var imgWidth=~~(core.material.images.tilesets[editor.info.images].width/32);
var x0=stepPostfix[0].x; var x0=stepPostfix[0].x;
@ -816,7 +813,6 @@ editor.prototype.listen = function () {
for (var ii = 0; ii < stepPostfix.length; ii++) for (var ii = 0; ii < stepPostfix.length; ii++)
editor[editor.layerMod][stepPostfix[ii].y][stepPostfix[ii].x] = editor.info; editor[editor.layerMod][stepPostfix[ii].y][stepPostfix[ii].x] = editor.info;
} }
}
// console.log(editor.map); // console.log(editor.map);
editor.updateMap(); editor.updateMap();
holdingPath = 0; holdingPath = 0;

View File

@ -432,11 +432,16 @@ maps.prototype.drawBlock = function (block, animate, dx, dy) {
if (!blockInfo.isTileset) x = (animate||0)%(block.event.animate||1); if (!blockInfo.isTileset) x = (animate||0)%(block.event.animate||1);
if (core.isset(block.name)) { if (core.isset(block.name)) {
core.clearMap(block.name, block.x * 32, block.y * 32, 32, 32); core.clearMap(block.name, block.x * 32, block.y * 32 + 32 - height, 32, height);
if (block.name == 'bg') { if (block.name == 'bg') {
if (height>32) {
core.clearMap(block.name, block.x * 32, block.y * 32 - 32, 32, 32);
core.drawImage('bg', core.material.groundCanvas.canvas, block.x * 32, block.y * 32 - 32);
}
core.drawImage('bg', core.material.groundCanvas.canvas, block.x * 32, block.y * 32); core.drawImage('bg', core.material.groundCanvas.canvas, block.x * 32, block.y * 32);
} }
core.drawImage(block.name, image, x * 32, y * 32, 32, 32, block.x * 32, block.y * 32, 32, 32); core.drawImage(block.name, image, x * 32, y * height, 32, height,
block.x * 32, block.y * 32 + 32 - height, 32, height);
return; return;
} }