| 
 
| 赞 | 36 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 96 |  
| 经验 | 0 |  
| 最后登录 | 2025-10-26 |  
| 在线时间 | 462 小时 |  
 Lv4.逐梦者 
	梦石2 星屑7638 在线时间462 小时注册时间2021-12-4帖子492 
 | 
| “自动消失”那肯定要借用“进入新地图时左上角显示地图名称”的那个区域。下面的代码是rmmz的,希望rmmv也能用。 // 5. 左上角临时提示,可以指定几秒后开始淡出,文字内容支持转义序列
 170
 Game_Message.prototype.drawTip = function (text, time = 2) {
 171
 if (typeof text === 'string' && SceneManager._scene instanceof Scene_Map) {
 172
 const w = SceneManager._scene._mapNameWindow;
 173
 w._showCount = time * 60;
 174
 w.refresh(w.convertEscapeCharacters(text));
 175
 }
 176
 };
 177
 Window_MapName.prototype.refresh = function (text) {
 178
 this.contents.clear();
 179
 if ((text ??= $gameMap.displayName()).trim().length > 0) {
 180
 const width = Math.max(this.textWidth(text), this.innerWidth / 3);
 181
 this.drawBackground(0, 0, width, this.lineHeight());
 182
 this.drawText(text, 0, 0, width, "center");
 183
 }
 184
 };
 185
 Scene_Map.prototype.mapNameWindowRect = function () {
 186
 const wx = 0;
 187
 const wy = 0;
 188
 const ww = Graphics.boxWidth * 3 / 4; // 宽度为UI区域3/4,最少绘制其1/3底色
 189
 const wh = this.calcWindowHeight(1, false);
 190
 return new Rectangle(wx, wy, ww, wh);
 191
 };
 | 
 |