diff --git a/libs/events.js b/libs/events.js index ed13cafb..43fdfd49 100644 --- a/libs/events.js +++ b/libs/events.js @@ -125,8 +125,7 @@ events.prototype.gameOver = function (ending, fromReplay) { // 清空图片和天气 core.clearMap('animate', 0, 0, 416, 416); - while (core.dom.gif2.firstChild) - core.dom.gif2.removeChild(core.dom.gif2.firstChild); + core.dom.gif2.innerHTML = ""; core.clearMap('weather', 0, 0, 416, 416) core.animateFrame.weather.type = null; core.animateFrame.weather.level = 0; @@ -454,8 +453,7 @@ events.prototype.doAction = function() { core.dom.gif2.appendChild(gif); } else { - while (core.dom.gif2.firstChild) - core.dom.gif2.removeChild(core.dom.gif2.firstChild); + core.dom.gif2.innerHTML = ""; } this.doAction(); break; @@ -966,11 +964,6 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback else core.setWeather(); // 清除gif - /* - while (core.dom.gif.firstChild) { - core.dom.gif.removeChild(core.dom.gif.firstChild); - } - */ core.dom.gif.innerHTML = ""; // 检查重生 diff --git a/libs/maps.js b/libs/maps.js index 008f8676..fa80da9f 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -331,8 +331,7 @@ maps.prototype.drawMap = function (mapName, callback) { if (!t[3]) { core.canvas.bg.drawImage(image, dx * ratio, dy * ratio, Math.min(size - dx * ratio, ratio * image.width), Math.min(size - dy * ratio, ratio * image.height)); if (/.*\.gif/i.test(p)) { - while (core.dom.gif.firstChild) - core.dom.gif.removeChild(core.dom.gif.firstChild); + core.dom.gif.innerHTML = ""; var gif = new Image(); gif.src = core.material.images.images[p].src; gif.style.position = 'absolute'; diff --git a/libs/ui.js b/libs/ui.js index cb770991..605329fd 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -20,8 +20,7 @@ ui.prototype.clearMap = function (map, x, y, width, height) { for (var m in core.canvas) { core.canvas[m].clearRect(0, 0, 416, 416); } - while (core.dom.gif.firstChild) - core.dom.gif.removeChild(core.dom.gif.firstChild); + core.dom.gif.innerHTML = ""; } else { core.canvas[map].clearRect(x||0, y||0, width||416, height||416); diff --git a/project/data.js b/project/data.js index 1d14035d..f89ed041 100644 --- a/project/data.js +++ b/project/data.js @@ -5,7 +5,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "sample0", "sample1", "sample2", "MT0" ], "images" : [ - "bg.jpg" + "bg.jpg", "timg.gif" ], "animates" : [ "hand", "sword", "zone", diff --git a/project/floors/sample0.js b/project/floors/sample0.js index 78e04a85..209b29cd 100644 --- a/project/floors/sample0.js +++ b/project/floors/sample0.js @@ -9,7 +9,7 @@ main.floors.sample0 = "canFlyTo": true, // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) "canUseQuickShop": true, // 该层是否允许使用快捷商店 "defaultGround": "ground", // 默认地面的图块ID(terrains中) - "images": [], // 该层默认显示的所有图片;详细用法请查看文档“自定义素材”中的说明。 + "images": [[0,0,"timg.gif",false]], // 该层默认显示的所有图片;详细用法请查看文档“自定义素材”中的说明。 // "color": [0,0,0,0.3] // 该层的默认画面色调。本项可不写(代表无色调),如果写需要是一个RGBA数组。 // "weather": ["snow",5], // 该层的默认天气。本项可忽略表示晴天,如果写则第一项为"rain"或"snow"代表雨雪,第二项为1-10之间的数代表强度。 "bgm": "bgm.mp3", // 到达该层后默认播放的BGM。本项可忽略。 diff --git a/project/images/timg.gif b/project/images/timg.gif new file mode 100644 index 00000000..c2065e4a Binary files /dev/null and b/project/images/timg.gif differ