I've been working with MV for a while now and I just came across a problem. What I've got is a scene where I need to have two windows slide out of frame only to return to frame with new contents, but no matter what I try, the screen refuses to update. I'm not sure what to do.
Here's my code:
var win1 = this._pokemonWindows[this.index()];
var win2 = this._pokemonWindows[this._pendingIndex];
var oldCoordinates = [[win1.x, win1.y], [win2.x, win2.y]];
while (win1.x > 0 && win1.x < Graphics.boxWidth) {
if (win1.positionIndex() % 2 == 0) {
win1.x -= 10;
win1.x = Math.max(win1.x, 0);
} else {
win1.x += 10;
win1.x = Math.min(win1.x, Graphics.boxWidth);
};
if (win2.positionIndex() % 2 == 0) {
win2.x -= 10;
win2.x = Math.max(win2.x, 0);
} else {
win2.x += 10;
win2.x = Math.min(win2.x, Graphics.boxWidth);
};
win1.update();
win2.update();
};
$gameParty.trainer().swapOrder(win1.positionIndex(), win2.positionIndex());
win2.removePending();
win1.changePokemon($gameParty.members()[win1.positionIndex()]);
win2.changePokemon($gameParty.members()[win2.positionIndex()]);
this.select(this._pendingIndex);
while (win1.x != oldCoordinates[0][0]) {
if (win1.positionIndex() % 2 == 0) {
win1.x += 10;
win1.x = Math.min(win1.x, oldCoordinates[0][0]);
} else {
win1.x -= 10;
win1.x = Math.max(win1.x, oldCoordinates[0][0]);
};
if (win2.positionIndex() % 2 == 0) {
win2.x += 10;
win2.x = Math.min(win2.x, oldCoordinates[1][0]);
} else {
win2.x -= 10;
win2.x = Math.max(win2.x, oldCoordinates[1][0]);
};
win1.update();
win2.update();
};
Scene_Pokemon._lastIndex = this.index();
this._pendingIndex = -1;
this._helpWindow.setText("Choose a Pokémon.");
Could one of you give me a hint as to what command I need to do the get the screen to refresh to show the movement, cause it seems like Graphics.update isn't a thing in MV.