How to change the X position of 'Window_BattleEnemy'?

RicoRob

Veteran
Veteran
Joined
Apr 28, 2016
Messages
59
Reaction score
4
First Language
Portuguese (Br)
Primarily Uses
RMMV
I'm trying to change the x position of the Enemy Window (where the player selects which enemy to attack), but no matter what number I add/subtract/replace the 'x' with, the window won't move. I can change the 'y', the height and the width without problems. The same thing happens in a new project.

I added the "- 20" but it does nothing:
(This edit was made in rpg_windows.js)
Code:
Window_BattleEnemy.prototype.initialize = function(x, y) {
    this._enemies = [];
    var width = this.windowWidth();
    var height = this.windowHeight();
    Window_Selectable.prototype.initialize.call(this, x - 20, y, width, height);
    this.refresh();
    this.hide();
};
However, if I add the "- 20" to any other property, the changes take effect. Why does the x ignore that? :dizzy:

On a similar topic, if I'm allowed to ask, how do I stop the Status Window from sliding left/right when the command window (attack/guard/item...) appear/disappear?

Thanks in advance.

PS.: Currently, I'm using SRD's Battle GUI Core to fix that and it works, but, using an advanced plugin just to change a single value is something I'm trying to avoid. And in case there's any compatibility issues in the future, I want to have a plan B.
 

trapless

Veteran
Veteran
Joined
Mar 3, 2014
Messages
43
Reaction score
16
First Language
English
Primarily Uses
You are changing the number during the windows creation. Scene_battle is changing the number after that..

Code:
Scene_Battle.prototype.createEnemyWindow = function() {
    this._enemyWindow = new Window_BattleEnemy(0, this._statusWindow.y);
    this._enemyWindow.x = Graphics.boxWidth - this._enemyWindow.width;  // <---- here
    this._enemyWindow.setHandler('ok',     this.onEnemyOk.bind(this));
    this._enemyWindow.setHandler('cancel', this.onEnemyCancel.bind(this));
    this.addWindow(this._enemyWindow);
};
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top