| 
 
| 赞 | 10 |  
| VIP | 0 |  
| 好人卡 | 2 |  
| 积分 | 66 |  
| 经验 | 16755 |  
| 最后登录 | 2025-10-31 |  
| 在线时间 | 1164 小时 |  
 Lv4.逐梦者 
	梦石0 星屑6635 在线时间1164 小时注册时间2006-7-18帖子560 | 
| 
本帖最后由 雷影 于 2023-9-24 20:50 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 代码本身是想学习时找到的别人教学时的教程内容,然后教学没有后续内容了。自己拿来用一下,无奈苦手!
 具体就是想在菜单画面时,显示一个窗口,显示当前游戏进度的基本内容任务。
 剧情进度值用个变量来记录,当到一定值时显示不同任务内容,因为是解密游戏,所以只设定一个主线进度。
 
 想要帮看的代码是第39行“窗口显示的内容”部分,
 如何正确获取指定ID变量的值,然后依照变量值显示不同内容(自己写的显然是错了)
 
 
 复制代码//-------------------------------------------------------------------------
//************
//创建一个独立窗口显示内容
//************
var _Scene_Menu_create = Scene_Menu.prototype.create;
Scene_Menu.prototype.create = function() {
    _Scene_Menu_create.call(this);
 
    //创建自定义窗口,并将它加入主菜单界面
    this._tipsWindow = new Window_Tips(0, 0);
    this._tipsWindow.y = this._commandWindow.y + this._commandWindow.height + 50; 
    //设置自定义窗口的Y坐标,由左上部的菜单命令窗口的Y轴坐标及其高度来决定
    this.addWindow(this._tipsWindow);
};
 
function Window_Tips() {
    this.initialize.apply(this, arguments);
}
 
Window_Tips.prototype = Object.create(Window_Base.prototype);
Window_Tips.prototype.constructor = Window_Tips;
 
Window_Tips.prototype.initialize = function(x, y) {
    var width = this.windowWidth();
    var height = this.windowHeight();
    Window_Base.prototype.initialize.call(this, x+200, y, width, height);
    this.refresh();
};
 
Window_Tips.prototype.windowWidth = function() {
    return 440; //自定义窗口的宽度
};
 
Window_Tips.prototype.windowHeight = function() {
    return this.fittingHeight(3); //自定义窗口的高度:通过设定窗口要容纳的行数来自动计算高度
};
//窗口显示的内容 
Window_Tips.prototype.refresh = function(actor) {
    this.contents.clear();
    var V = get.$gameVariables[100];//取得100号变量的值
    if(v==1){
         this.drawTextEx("剧情进度变量值为1时显示的内容", 0, 0);
    } else if (v == 2) {
          this.drawTextEx("剧情进度变量值为2时显示的内容", 0, 0);
    } else if (v == 3) {        
         this.drawTextEx("剧情进度变量值为3时显示的内容", 0, 0);   
    }
};
Window_Tips.prototype.open = function() {
    this.refresh();
    Window_Base.prototype.open.call(this);
};
 | 
 |