level 5
这个我不知道,我只知道在地图上显示气泡和动画的脚本。
把img\system文件夹Balloon.png的图片大小本来是384*720
要是直接放大10倍到3840*7200会很奇怪,因为读取的行数的宽度和高度是固定的。
但是可以把384的宽度固定下来,高度随意,画上其他图片后是可以突破10个、15个上限的。
384/8=48,720/15=48,所以好像是48一行的高度,多少随意。
Sprite_Balloon.prototype.updateFrame = function() {
const w = 48;
const h = 48;
const sx = this.frameIndex() * w;
const sy = (this._balloonId - 1) * h;
this.setFrame(sx, sy, w, h);
};
上面这段好像就是气泡的关键代码了,改成下面这样可以一次性显示出来。
Sprite_Balloon.prototype.updateFrame = function() {
const w = 48*8; //注释,在这里可以把48改成48*8,可以把气泡一次性都显示出来
const h = 48;
const sx = this.frameIndex() * w;
const sy = (this._balloonId - 1) * h;
this.setFrame(sx, sy, w, h);
};
【MZ教程】NPC在地图中自动显示气泡事件 - 哔哩哔哩
bilibili.com/opus/706677937458380822?spm_id_from=333.1387.0.0
//本事件显示2号气泡,
$gameTemp.requestBalloon($gameMap.event(this.eventId()), 2);
//1号事件页显示2号气泡
$gameTemp.requestBalloon($gameMap.event(1), 2);
//玩家显示2号气泡
$gameTemp.requestBalloon($gamePlayer, 2);
//本事件显示2号动画
$gameTemp.requestAnimation([this.character(this._characterId)], 2);
也是本事件显示2号动画
$gameTemp.requestAnimation([this.character(0)], 2);
//1号事件页显示2号动画
$gameTemp.requestAnimation([this.character(1)], 2);
//玩家显示2号动画
$gameTemp.requestAnimation([$gamePlayer], 2);
//也是玩家显示2号动画
$gameTemp.requestAnimation([this.character(-1)], 2);