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

Project1

 找回密码
 注册会员
搜索
查看: 364|回复: 3
打印 上一主题 下一主题

[有事请教] 如何在标题添加显示图片按钮?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
210
在线时间
26 小时
注册时间
2023-11-2
帖子
18
跳转到指定楼层
1
发表于 2023-12-24 23:09:34 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
30星屑
不知道怎么描述,你们看一下,大概就知道了

Screenshot_20231224_225346.jpg (736.69 KB, 下载次数: 7)

我点一下这个按钮,然后就会弹出一张图片

我点一下这个按钮,然后就会弹出一张图片

Screenshot_2023_1224_225238.png (149.58 KB, 下载次数: 7)

Scene_Title.prototype.commandPicture = function() { };,我该在这个大括号里面填什么 ...

Scene_Title.prototype.commandPicture = function() {           };,我该在这个大括号里面填什么 ...

Lv1.梦旅人

梦石
0
星屑
210
在线时间
26 小时
注册时间
2023-11-2
帖子
18
2
 楼主| 发表于 2023-12-24 23:32:11 | 只看该作者
this._commandWindow.close();
$gameScreen.showPicture(1,"0_003",0,0,0,0,100,100,255,0);
不行
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4140
在线时间
622 小时
注册时间
2018-1-16
帖子
127
3
发表于 2023-12-26 08:23:45 | 只看该作者
Drill大佬的插件合集里有“全自定义标题界面”
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
210
在线时间
26 小时
注册时间
2023-11-2
帖子
18
4
 楼主| 发表于 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);
};
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-4-27 16:55

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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