浙江网站建设工作室,装修设计网站哪个好,主要对布局进行,职业教育网站建设方案RPG Maker MV 仿新仙剑 战斗场景UI 八 状态及装备场景代码效果 状态及装备场景
本计划在战斗场景中直接制作的#xff0c;但考虑到在战斗场景中加入太多的窗口这不太合适#xff0c;操作也繁琐#xff0c;因此直接使用其他场景。
代码
Pal_Window_EquipStatus.prototype.… RPG Maker MV 仿新仙剑 战斗场景UI 八 状态及装备场景代码效果 状态及装备场景
本计划在战斗场景中直接制作的但考虑到在战斗场景中加入太多的窗口这不太合适操作也繁琐因此直接使用其他场景。
代码
Pal_Window_EquipStatus.prototype.drawNewParam function(paramId) {this.drawText(this._tempActor.param(paramId), 500, 1432*this._actorState.indexOf(paramId), 110, left);
};
al_Window_EquipStatus.prototype.drawCurrentParam function(paramId) {this.drawText(this._actor.param(paramId), 400, 1432*this._actorState.indexOf(paramId), 110, left);
};这里由于之前测试通过因此去掉绘制数值上的**9999**。
Pal_Scene_Battle.prototype.commandStates function() {SceneManager.push(Scene_Status);
};
Pal_Scene_Battle.prototype.commandEquip function() {SceneManager.push(Pal_Scene_Equip);
};直接前往这两个场景显示数据信息。 为了保证场景之间跳转后之前的操作保留看上去因此在对应场景中添加如下代码 Scene_Status.prototype.popScene function() {switch(SceneManager._stack[1].name){case Scene_Menu:break;case Pal_Scene_Battle:SceneManager.scene_windows.command1_activefalse;SceneManager.scene_windows.command2_activetrue;SceneManager.scene_windows.command3_activefalse;SceneManager.scene_windows.command1_index3;SceneManager.scene_windows.command2_index4;SceneManager.scene_windows.command3_index-1;break;default:break;}Scene_ItemBase.prototype.popScene.call(this);
};
Pal_Scene_Equip.prototype.popScene function() {switch(SceneManager._stack[1].name){case Scene_Menu:SceneManager.scene_windows.command1_activefalse;SceneManager.scene_windows.command2_activetrue;SceneManager.scene_windows.command3_activefalse;SceneManager.scene_windows.command1_index2;SceneManager.scene_windows.command2_index1;SceneManager.scene_windows.command3_index-1;break;case Pal_Scene_Battle:SceneManager.scene_windows.command1_activefalse;SceneManager.scene_windows.command2_activefalse;SceneManager.scene_windows.command3_activetrue;SceneManager.scene_windows.command1_index3;SceneManager.scene_windows.command2_index0;SceneManager.scene_windows.command3_index2;break;default:break;}Scene_ItemBase.prototype.popScene.call(this);
};这是在场景管理器中设置跳转后的操作信息涉及到返回的场景有战斗场景和主菜单场景。
Pal_Scene_Battle.prototype.initWindons function() {if(!SceneManager.scene_windows.command1_active){if(!SceneManager.scene_windows.command2_active){if(SceneManager.scene_windows.command3_active){this._actorCommandWindow._indexSceneManager.scene_windows.command1_index;this.commandOther();this._otherCommandWindow._indexSceneManager.scene_windows.command2_index;this.commandOperateItem();this._itemCommandWindow._indexSceneManager.scene_windows.command3_index;this._actorCommandWindow.deactivate();this._otherCommandWindow.deactivate();SceneManager.initScene_windows()}}else{//从状态场景返回战斗场景this._actorCommandWindow._indexSceneManager.scene_windows.command1_index;this.commandOther();this._otherCommandWindow._indexSceneManager.scene_windows.command2_index;this._actorCommandWindow.deactivate();SceneManager.initScene_windows();}}
};
/** * 开始队伍命令选择*/
Pal_Scene_Battle.prototype.startPartyCommandSelection function() {this._statusWindow.deselect();this._statusWindow.open();this.refreshStatus();this._actorCommandWindow.close();this.selectNextCommand();this.initWindons();
};然后再对应的场景使用即可不过现在发现问题还挺多的比如会有明显的UI跳动痕迹显示不自然等后续慢慢优化吧 主菜单场景的就不发出来了那个写出来比战斗的场景简单太多了
效果
这效果其实还挺有喜剧效果的。 将窗口打开的速度降低的最低后可以看到最先出现的就是状态的显示。 正常来说应该先显示人物的战斗指令的但看来没有先显示同时额外战斗的指令窗口打开的也很有喜感是在慢慢的不断拉开的效果同时默认可以看到就在道具这个选项上但这是从状态返回的啊所有全部展开后才跳到状态选项所有会有UI跳动的情况。 这里可以看到额外和物品的指令窗口是同步打开的这里看着非常明显但战斗的指令窗口却得等到这两个窗口全部展开后才能显示之后就是指令下标的跳转及UI的变动。 不知道大家有什么好的优化手段可以提出来学习学习大家的先进经验