设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索

如何在标题添加显示图片按钮?

查看数: 376 | 评论数: 3 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2023-12-24 23:09

正文摘要:

不知道怎么描述,你们看一下,大概就知道了

回复

不自知 发表于 2023-12-26 21:46:51
//自己研究出来了。。。
//看着用吧
var Picture_Window_TitleCommand_prototype_makeCommandList = Window_TitleCommand.prototype.makeCommandList

Picture_Scene_Title_prototype_createCommandWindow = Scene_Title.prototype.createCommandWindow

Window_TitleCommand.prototype.makeCommandList = function() {
    Picture_Window_TitleCommand_prototype_makeCommandList.call(this);
        this.addCommand('你想要的名字', 'picture',true);
};

Scene_Title.prototype.createCommandWindow = function() {
    Picture_Scene_Title_prototype_createCommandWindow.call(this);
        this._commandWindow.setHandler('picture',  this.commandPicture.bind(this));
   
};

Scene_Title.prototype.commandPicture = function() {
    SceneManager.goto(Scene_Picture);
   
};

function Scene_Picture() {
    this.initialize.apply(this, arguments);
}

Scene_Picture.prototype = Object.create(Scene_Base.prototype);
Scene_Picture.prototype.constructor = Scene_Picture;

Scene_Picture.prototype.initialize = function() {
    Scene_Base.prototype.initialize.call(this);
};

Scene_Picture.prototype.create = function() {
    Scene_Base.prototype.create.call(this);
   
    this.createBackground();
};

Scene_Picture.prototype.start = function() {
    Scene_Base.prototype.start.call(this);
    this.startFadeIn(this.slowFadeSpeed(), false);
};

Scene_Picture.prototype.update = function() {
    if (this.isActive() && !this.isBusy() && this.isTriggered()) {
        this.gotoTitle();
    }
    Scene_Base.prototype.update.call(this);
};

Scene_Picture.prototype.stop = function() {
    Scene_Base.prototype.stop.call(this);
    this.fadeOutAll();
};

Scene_Picture.prototype.terminate = function() {
    Scene_Base.prototype.terminate.call(this);
    AudioManager.stopAll();
};

Scene_Picture.prototype.createBackground = function() {
    this._backSprite = new Sprite();
    this._backSprite.bitmap = ImageManager.loadPicture('文件名,文件放pictures文件夹里');
    this.addChild(this._backSprite);
};

Scene_Picture.prototype.isTriggered = function() {
    return Input.isTriggered('ok') || TouchInput.isTriggered();
};

Scene_Picture.prototype.gotoTitle = function() {
    SceneManager.goto(Scene_Title);
};
shantianzu 发表于 2023-12-26 08:23:45
Drill大佬的插件合集里有“全自定义标题界面”
不自知 发表于 2023-12-24 23:32:11
this._commandWindow.close();
$gameScreen.showPicture(1,"0_003",0,0,0,0,100,100,255,0);
不行
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-10 00:45

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表