| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 2 |
| 经验 | |
| 最后登录 | 2021-5-21 |
| 在线时间 | 41 小时 |
- 梦石
- 0
- 星屑
- 229
- 在线时间
- 41 小时
- 注册时间
- 2019-12-29
- 回帖
- 3
|
发表于 2019-12-30 01:30:50
|
显示全部楼层
交作业,真的就是照抄Window_Gold:
[pre lang="javascript"]
Window_Gold.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawIcon(313, 0, 0);
this.drawCurrencyValue(this.value(), this.currencyUnit(), x, 0, width);
};
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);
this.drawText(this.commandName(index), rect.x+36, rect.y, rect.width, align);
};
Scene_Menu.prototype.create = function() {
//场景菜单基础 创建 呼叫(this)
Scene_MenuBase.prototype.create.call(this);
//创建命令窗口()
this.createCommandWindow();
//创建金钱窗口()
this.createGoldWindow();
//创建状态窗口()
this.createStatusWindow();
this.createStepWindow();
};
Scene_Menu.prototype.createStepWindow = function() {
//金钱窗口 = 新 窗口金钱(0,0)
this._StepWindow = new Window_Step(0, 0);
//金钱窗口 y = 图形 盒高 - 金钱窗口 高
this._StepWindow.y = Graphics.boxHeight - this._StepWindow.height*2;
//添加窗口(金钱窗口)
this.addWindow(this._StepWindow);
}
function Window_Step() {
this.initialize.apply(this, arguments);
}
Window_Step.prototype = Object.create(Window_Base.prototype);
Window_Step.prototype.constructor = Window_Step;
Window_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_Step.prototype.windowWidth = function() {
return 240;
};
Window_Step.prototype.windowHeight = function() {
return this.fittingHeight(1);
};
Window_Step.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawIcon(176, 0, 0);
this.drawCurrencyValue(this.value(), this.currencyUnit(), x, 0, width);
};
Window_Step.prototype.value = function() {
return $gameParty.steps();
};
Window_Step.prototype.currencyUnit = function() {
return 's';
};[/pre] |
|