Manually Refresh Screen

Crystal Noel

Veteran
Veteran
Joined
Jun 17, 2012
Messages
113
Reaction score
32
First Language
English
Primarily Uses
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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Shade the Mystic wrote on YouFulca's profile.
I just wanted to drop you a line to tell you that you are flipping amazing. I've listened to a few RM composers over the years, and while they all had their strengths, yours is the only work I'd dare call memorable. I honestly don't think I've heard such amazing RM scores outside of Yasunori Mitsuda, no joke. Keep up the amazing work!
Seamless secret passages just by painting a path with a region id. Simple but slick.
Playing with colour ramps. The first set is the originals, the ones only facing forward in different colour schemes are the new colours.

I present... MAGIC (in progress)

Forum statistics

Threads
102,979
Messages
996,444
Members
134,447
Latest member
Smashbroly
Top