赞 | 10 |
VIP | 0 |
好人卡 | 0 |
积分 | 4 |
经验 | 0 |
最后登录 | 2022-3-2 |
在线时间 | 48 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 390
- 在线时间
- 48 小时
- 注册时间
- 2020-4-24
- 帖子
- 61
|
本帖最后由 haiyin 于 2021-11-14 19:02 编辑
找到问题了,我之前所做的都只是新增了窗口,但是并没有在scenes中显示出来...好像还没有人交作业,我就交下作业吧 有点乱..
- /*:
- *@author 作者
- *@plugindesc 插件描述
- *@help 帮助文档
- *
- *
- */
- (function() {
- //金钱窗口
- function Window_DIY_Gold() {
- this.initialize.apply(this, arguments);
- }
- //继承Window_Gold.prototype
- Window_DIY_Gold.prototype = Object.create(Window_Gold.prototype);
- Window_DIY_Gold.prototype.constructor = Window_DIY_Gold;
- //刷新
- Window_DIY_Gold.prototype.refresh = function() {
- Window_Gold.prototype.refresh.call(this);
- this.drawIcon(313, 0, 0);
- };
- //创建窗口
- Scene_Menu.prototype.createGoldWindow = function() {
- this._goldWindow = new Window_DIY_Gold(0, 0);
- this._goldWindow.y = Graphics.boxHeight - this._goldWindow.height;
- this.addWindow(this._goldWindow);
- };
- //添加菜单图标 iconIndex对应的是菜单中从0开始的菜单选项索引值对应的图标索引值
- var iconIndex = [208, 64, 137, 84, 75, 242, 229, 82];
- Window_MenuCommand.prototype.drawItem = function(index) {
- //选项
- var rect = this.itemRectForText(index);
- //排列方式
- var align = this.itemTextAlign();
- //文字颜色
- this.resetTextColor();
- //透明状态
- this.changePaintOpacity(this.isCommandEnabled(index));
- //图标
- this.drawIcon(iconIndex[index], rect.x, rect.y);
- //MV中图标的大小是36*36,因此文字的x值应该向右也就是加上36 参数:名称 x y 宽 排列方式
- this.drawText(this.commandName(index), rect.x + 36, rect.y, rect.width - 36, align);
- }
- //创建步数窗口
- function Window_DIY_Step() {
- this.initialize.apply(this, arguments);
- }
- Window_DIY_Step.prototype = Object.create(Window_Base.prototype);
- //创建构造函数
- Window_DIY_Step.prototype.constructor = Window_DIY_Step;
- Window_DIY_Step.prototype.initialize = function(x, y) {
- var width = this.windowWidth();
- var height = this.windowHeight();
- Window_Base.prototype.initialize.call(this, x, y, width, height);
- this.refresh();
- };
- Window_DIY_Step.prototype.windowWidth = function() {
- return 240;
- };
- Window_DIY_Step.prototype.windowHeight = function() {
- return this.fittingHeight(1);
- };
- Window_DIY_Step.prototype.refresh = function() {
- var x = this.textPadding();
- var width = this.contents.width - this.textPadding() * 2;
- this.contents.clear();
- this.drawIcon(82, 0, 0);
- this.drawCurrencyValue(this.value(), this.currencyUnit(), x, 0, width);
- };
- Window_DIY_Step.prototype.value = function() {
- return $gameParty.steps();
- };
- Window_DIY_Step.prototype.currencyUnit = function() {
- return "S";
- };
- Window_DIY_Step.prototype.open = function() {
- this.refresh();
- Window_Base.prototype.open.call(this);
- };
- //新增步数窗口
- Scene_Menu.prototype.createWindowDIYStep = function() {
- this._stepWindow = new Window_DIY_Step(0, 0);
- //设置上边距
- this._stepWindow.y = Graphics.boxHeight - this._stepWindow.height*2 - 5;
- this.addWindow(this._stepWindow);
- }
- //显示菜单窗口
- Scene_Menu.prototype.create = function() {
- Scene_MenuBase.prototype.create.call(this);
- this.createCommandWindow();
- this.createGoldWindow();
- this.createStatusWindow();
- this.createWindowDIYStep();
- };
- })();
复制代码 |
-
zy.PNG
(780.04 KB, 下载次数: 53)
展示
评分
-
查看全部评分
|