赞 | 8 |
VIP | 0 |
好人卡 | 2 |
积分 | 75 |
经验 | 16755 |
最后登录 | 2024-11-16 |
在线时间 | 1100 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7450
- 在线时间
- 1100 小时
- 注册时间
- 2006-7-18
- 帖子
- 572
|
如果仅仅是状态栏的话,可以试试这个,以前找人帮写的一段,然后在显示装备 数值那两行代码用 // 两个斜杠注释掉就行了,其他项目也是,只注释 显示数据的哪一行就好,注释其他多余的代码可能导致出错(本质上也只是正常运算,不显示出来而已)
一个一个测试吧!
- //=============================================================================
- // Window_Status
- //=============================================================================
- /*:
- * @plugindesc 状态栏重新排版
- *
- */
- //-----------------------------------------------------------------------------
- Window_Status.prototype = Object.create(Window_Selectable.prototype);
- Window_Status.prototype.constructor = Window_Status;
- Window_Status.prototype.initialize = function() {
- var width = Graphics.boxWidth-200;
- var height = Graphics.boxHeight/1.6;
- Window_Selectable.prototype.initialize.call(this, 100, 50, width, height);
- this.refresh();
- this.activate();
- };
- function Window_Status() {
- this.initialize.apply(this, arguments);
- }
- Window_Status.prototype.setActor = function(actor) {
- if (this._actor !== actor) {
- this._actor = actor;
- this.refresh();
- }
- };
- Window_Status.prototype.refresh = function() {
- this.contents.clear();
- if (this._actor) {
- var lineHeight = this.lineHeight();
- this.drawBlock1(lineHeight * 0);
- this.drawHorzLine(lineHeight * 1);
- this.drawBlock2(lineHeight * 2);
- this.drawHorzLine(lineHeight * 6);
- this.drawBlock3(lineHeight * 7);
- this.drawHorzLine(lineHeight * 13);
- this.drawBlock4(lineHeight * 14);
- }
- };
- //角色名字 职业 称号位置
- Window_Status.prototype.drawBlock1 = function(y) {
- this.contents.fontSize = 25;
- this.drawActorName(this._actor, 140, y); //名字
- this.drawActorClass(this._actor, 140, y+40);//职业
- this.drawActorNickname(this._actor, 400, y);//称号
- };
- //显示头像
- Window_Status.prototype.drawBlock2 = function(y) {
- // this.drawActorFace(this._actor, 10, 10);
- this.drawBasicInfo(200, y);
- this.drawExpInfo(400, y);
- };
- //装备,能力值显示的位置
- Window_Status.prototype.drawBlock3 = function(y) {
- this.contents.fontSize = 25;
- this.drawEquipments(10, y -70);//装备显示的位置
- this.drawParameters(300, y -70);//能力值显示的位置
- };
- Window_Status.prototype.drawBlock4 = function(y) {
- this.drawProfile(6, y);//人物简介
- };
- Window_Status.prototype.drawHorzLine = function(y) {
- var lineY = y + this.lineHeight() / 2 - 1;
- this.contents.paintOpacity = 48;
- this.contents.fillRect(0, lineY, this.contentsWidth(), 2, this.lineColor());
- this.contents.paintOpacity = 255;
- };
- Window_Status.prototype.lineColor = function() {
- return this.normalColor();
- };
- //等级 异常状态图标 HP MP位置
- Window_Status.prototype.drawBasicInfo = function(x, y) {
- this.contents.fontSize = 25;
- var lineHeight = this.lineHeight();
- this.drawActorLevel(this._actor, 140, y + lineHeight * 0);
- this.drawActorIcons(this._actor, 10, y + lineHeight * 1 + 20);
- this.drawActorHp(this._actor, 140, y + lineHeight * 1 -10);
- this.drawActorMp(this._actor, 140, y + lineHeight * 2 );
- };
- //HP MP数值描绘
- Window_Status.prototype.drawParameters = function(x, y) {
- this.contents.fontSize = 25;
- var lineHeight = this.lineHeight();
- for (var i = 0; i < 6; i++) {
- var paramId = i + 2;
- var y2 = y + lineHeight * i;
- this.changeTextColor(this.systemColor());
- this.drawText(TextManager.param(paramId), x, y2, 160);
- this.resetTextColor();
- this.drawText(this._actor.param(paramId), x + 160, y2, 60, 'right');
- }
- };
- //绘制经验值位置
- Window_Status.prototype.drawExpInfo = function(x, y) {
- var lineHeight = this.lineHeight();
- this.contents.fontSize = 25;
- //var expTotal = TextManager.expTotal.format(TextManager.exp);
- var expNext = TextManager.expNext.format(TextManager.level);
- //var value1 = this._actor.currentExp();
- var value2 = this._actor.nextRequiredExp();
- if (this._actor.isMaxLevel()) {
- // value1 = '-----';
- value2 = '-----';
- }
-
- this.changeTextColor(this.systemColor());
-
- //this.drawText(expTotal, x, y + lineHeight * 1 - 70 , 160,'right');
- this.drawText(expNext, x, y + lineHeight * 4 - 70 , 110,'right');
- this.resetTextColor();
- //this.drawText(value1, x, y + lineHeight * 2 - 70 , 160,'right');
- this.drawText(value2, x, y + lineHeight * 4 - 70 , 160,'right');
- };
- //装备显示
- Window_Status.prototype.drawEquipments = function(x, y) {
- this.contents.fontSize = 25;
- var equips = this._actor.equips();
- var count = Math.min(equips.length, this.maxEquipmentLines());
- for (var i = 0; i < count; i++) {
- this.drawItemName(equips[i], x, y + this.lineHeight() * i);
- }
- };
- //显示简介
- Window_Status.prototype.drawProfile = function(x, y) {
- this.drawTextEx(this._actor.profile(), x, y);
- };
- Window_Status.prototype.maxEquipmentLines = function() {
- return 6;
- };
- //-----------------------------------------------------------------------------
- // Window_Status2_xiamian
- //在下方显示一个简介窗口
- // The window for displaying full status on the status screen.
- var Status_xiamian_create = Scene_Status.prototype.create
- Scene_Status.prototype.create = function() {
- Status_xiamian_create.call(this);
- this._status_xiamianWindow = new Window_Status_xiamian();
- this.addWindow(this._status_xiamianWindow);
- };
-
- var Status_xiamian_refreshActor = Scene_Status.prototype.refreshActor
- Scene_Status.prototype.refreshActor = function() {
- Status_xiamian_refreshActor.call(this);
- var actor = this.actor();
- this._status_xiamianWindow.setActor(actor);
- };
-
-
- function Window_Status_xiamian() {
- this.initialize.apply(this, arguments);
- }
-
- Window_Status_xiamian.prototype = Object.create(Window_Selectable.prototype);
- Window_Status_xiamian.prototype.constructor = Window_Status_xiamian;
-
-
- Window_Status_xiamian.prototype.initialize = function() {
- var width = Graphics.boxWidth;
- var height = Graphics.boxHeight/4;
- var x = 0
- var y = Graphics.boxHeight/1.4
- Window_Selectable.prototype.initialize.call(this, x, y, width, height);
- this._actor = null;
- this.refresh();
- this.activate();
- };
-
- Window_Status_xiamian.prototype.setActor = function(actor) {
- if (this._actor !== actor) {
- this._actor = actor;
- this.refresh();
- }
- };
-
- Window_Status_xiamian.prototype.refresh = function() {
- this.contents.clear();
- if (!this._actor) {return}
- console.log(this._actor)
-
- this.drawTextEx(this._actor.profile(), 0, 0);
-
- };
- //-----------------------------------------------------------------------------
- // Window_Status_xiamian
- //在上方显示一个头像窗口
- // The window for displaying full status on the status screen.
-
- var Status_xiamian2_create = Scene_Status.prototype.create
- Scene_Status.prototype.create = function() {
- Status_xiamian2_create.call(this);
- this._status_xiamian2Window = new Window_Status_xiamian2();
- this.addWindow(this._status_xiamian2Window);
- };
-
- var Status_xiamian2_refreshActor = Scene_Status.prototype.refreshActor
- Scene_Status.prototype.refreshActor = function() {
- Status_xiamian2_refreshActor.call(this);
- var actor = this.actor();
- this._status_xiamian2Window.setActor(actor);
- };
-
-
- function Window_Status_xiamian2() {
- this.initialize.apply(this, arguments);
- }
-
- Window_Status_xiamian2.prototype = Object.create(Window_Selectable.prototype);
- Window_Status_xiamian2.prototype.constructor = Window_Status_xiamian2;
-
-
- Window_Status_xiamian2.prototype.initialize = function() {
- var width2 = 156;
- var height2 = 156;
- var x = 80
- var y = 30
- Window_Selectable.prototype.initialize.call(this, x, y, width2, height2);
- this._actor = null;
- this.refresh();
- this.activate();
- };
-
- Window_Status_xiamian2.prototype.setActor = function(actor) {
- if (this._actor !== actor) {
- this._actor = actor;
- this.refresh();
- }
- };
-
- Window_Status_xiamian2.prototype.refresh = function() {
- this.contents.clear();
- if (!this._actor) {return}
- console.log(this._actor)
- this.drawActorFace(this._actor, -12, -12);
-
- };
复制代码 |
|