(RPG MV)I have a problem about create Window_BattleStatus in horizontal

poppicha

Villager
Member
Joined
Aug 30, 2015
Messages
10
Reaction score
4
First Language
Thai
Primarily Uses
RMMV
I want my game to have 7battleMembers and try to make battleStatus like this

This is the horizontal battleStatus in game that i want
Horizontal_Win.png


I try to create it but the result is like this
It's not go in a horizontal way but vertical way

My_Battlestatus.png


This is my code. Can you help me to have my battleStatus go in horizontal way like the 1st Pic?
JavaScript:
//-----------------------------------------------------------------------------
// Window_BattleStatus
//
// The window for displaying the status of party members on the battle screen.

function Window_BattleStatus() {
this.initialize.apply(this, arguments);
}

Window_BattleStatus.prototype = Object.create(Window_Selectable.prototype);
Window_BattleStatus.prototype.constructor = Window_BattleStatus;

Window_BattleStatus.prototype.initialize = function() {
var width = this.windowWidth();
var height = this.windowHeight();
var x = Graphics.boxWidth - width;
var y = Graphics.boxHeight - height;
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this.refresh();
this.openness = 0;
};

Window_BattleStatus.prototype.windowWidth = function() {
return Graphics.boxWidth;
};

Window_BattleStatus.prototype.windowHeight = function() {
return 178;
};

Window_BattleStatus.prototype.maxItems = function() {
return $gameParty.battleMembers().length;
};

Window_BattleStatus.prototype.maxPageRows = function() {
return 1;
};

Window_BattleStatus.prototype.numVisibleRows = function() {
return 1;
};

Window_BattleStatus.prototype.maxCols = function() {
return 3;
};

Window_BattleStatus.prototype.drawBattleActorHp = function(actor, x, y, width) {
width = width || 186;
this.contents.fontBold = true;
this.drawText(TextManager.hpA, x, y, 44);
this.contents.fontBold = false;
this.drawCurrentAndMax(actor.hp, actor.mhp, x - 70, y, width);
};

Window_BattleStatus.prototype.drawBattleActorMp = function(actor, x, y, width) {
width = width || 186;
this.contents.fontBold = true;
this.drawText(TextManager.mpA, x, y, 44);
this.contents.fontBold = false;
this.drawCurrentAndMax(actor.mp, actor.mmp, x - 70, y, width);
};

Window_BattleStatus.prototype.drawItem = function(index) {
var actor = $gameParty.battleMembers()[index];
var rect = this.itemRectForText(index);
this.drawActorFace(actor, rect.x, rect.y + 2);
this.drawActorName(actor, rect.x, rect.y - 6, 150);
this.drawBattleActorHp(actor, rect.x + 0, rect.y + 84, 201);
this.drawBattleActorMp(actor, rect.x + 0, rect.y + 104, 201);
};

Window_BattleStatus.prototype.refresh = function() {
this.contents.clear();
this.drawItems();
};
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,473
Reaction score
5,596
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.

 

Latest Threads

Latest Posts

Latest Profile Posts

Quite the versatile cast so far :p

chars.PNG

Edit: Sprites are made by Alexdraws and TheMightyPalm. I just edited them.
Degica Games Turn Komodo | RPG Maker News #77

Well, rats. Was really looking forward to trying out FPS Creator, but trying to install and set it up was pretty much impossible for my tiny brain to comprehend. So much for that, then.
Ah, home once more! I think I can safely work on my games now.
Let's hope power remains on for the day

Forum statistics

Threads
112,412
Messages
1,068,124
Members
146,063
Latest member
laserdolphSHCH
Top