| 赞 | 2 |
| VIP | |
| 好人卡 | |
| 积分 | 14 |
| 经验 | |
| 最后登录 | 2021-1-30 |
| 在线时间 | 112 小时 |
- 梦石
- 0
- 星屑
- 1422
- 在线时间
- 112 小时
- 注册时间
- 2011-8-17
- 回帖
- 37
|
楼主 |
发表于 2017-11-2 21:37:44
|
显示全部楼层
对,就是你说的这个症状!
我练习一下,所以就改教程了。我想在插件界面选择图片就可以直接设置背景,不用编辑插件。我的想法不能用imagemanager吧?
- /*:
- * @plugindesc 主菜单管理
- * @author 来自网络教程
- * @help
-
-
- * @param 背景图片设置
- * @type struct<list1>[]
- * @desc 可选项
- * @default []
- * @param 菜单编辑
- * @desc 可选项
- * @type struct<list2>[]
- * @default []
- */
- /*~struct~list1:
-
- * @param 生效
- * @type boolean
- * @on 是
- * @off 否
- * @desc 否:false 是:true
- * @default true
-
- * @param 主菜单
- * @type file
- * @desc 主菜单背景使用的图片
- * @dir img\parallaxes
-
- * @param 物品栏
- * @type file
- * @desc 物品栏背景使用的图片
- * @dir img\parallaxes
-
- * @param 技能界面
- * @type file
- * @desc 技能界面背景使用的图片
- * @dir img\parallaxes
-
- * @param 装备界面
- * @type file
- * @desc 装备界面背景使用的图片
- * @dir img\parallaxes
-
- * @param 存档界面
- * @type file
- * @desc 存档界面背景使用的图片
- * @dir img\parallaxes
-
- * @param 其他界面
- * @type file
- * @desc 其他界面背景使用的图片
- * @dir img\parallaxes
- */
- /*~struct~list2:
- * @param 生效
- * @type boolean
- * @on 是
- * @off 否
- * @desc 否:false 是:true
- * @default true
-
- * @param 名称
- * @desc 显示在菜单中的名称
- * @type text
-
-
- * @param 命令
- * @desc 英文命令
- * @type text
- */
- var params = PluginManager.parameters("edit_menu");
- Scene_MenuBase.prototype.createBackground = function() {
- this._backgroundSprite=new Sprite();
-
- ImageManager.loadParallax = function(filename, hue) {
- return this.loadBitmap('img/Parallax/', filename, hue, true);
- };
-
- var imageName;
- if(this instanceof Scene_Menu){
- imageName = params['主菜单'];
- }else if(this instanceof Scene_Item){
- imageName = params['物品栏']
- }else if(this instanceof Scene_Skill){
- imageName = params['技能界面']
- }else if(this instanceof Scene_Equip){
- imageName = params['装备界面']
- }else if(this instanceof Scene_Save || this instanceof Scene_Load) {
- imageName = params['存档界面']
- }else{
- imageName = params['其他界面']
- }
- this._backgroundSprite.bitmap=ImageManager.loadParallax(imageName);
- this.addChild(this._backgroundSprite);
- };
- Window_MenuCommand.prototype.addOriginalCommands = function () {
- this.addCommand(params['名称'], params['命令'],true);
- };
- var _Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
- Scene_Menu.prototype.createCommandWindow = function () {
- _Scene_Menu_createCommandWindow.call(this);
- this._commandWindow.setHandler(params['命令'], this.commandRename.bind(this));
- };
- Scene_Menu.prototype.commandRename = function () {
- this._statusWindow.setFormationMode(false);
- this._statusWindow.selectLast();
- this._statusWindow.activate();
- this._statusWindow.setHandler('ok', this.rename_ok.bind(this));
- this._statusWindow.setHandler('cancel', this.rename_cancel.bind(this));
- };
- Scene_Menu.prototype.rename_ok = function() {
- SceneManager.push(Scene_Name);
- SceneManager.prepareNextScene($gameParty.menuActor()._actorId, 10);
- };
- Scene_Menu.prototype.rename_cancel = function() {
- this._statusWindow.deselect();
- this._commandWindow.activate();
- };
- Window_MenuStatus.prototype.processOk = function() {
- $gameParty.setMenuActor($gameParty.members()[this.index()]);
- Window_Selectable.prototype.processOk.call(this);
- };
复制代码
|
|