jjleroy

I love bananas
Veteran
Joined
Aug 5, 2017
Messages
184
Reaction score
34
First Language
German, English
Primarily Uses
RMMV
I want to slowly move the message box guys...
How can I gradually change x until it reaches 100...

Code:
for (i = 0; i < 100; i++) {
        this.x += i}
 
Last edited:

Hyouryuu-Na

Very very lazy
Veteran
Joined
Jun 15, 2017
Messages
1,102
Reaction score
2,888
First Language
Not English
Primarily Uses
RMMV
The code seems fine. But you wanna add i<=100 in the first line. Btw the message window's x is this: SceneManager._scene._messageWindow.x
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,840
Reaction score
2,179
First Language
EN
Primarily Uses
RMMZ
Your code will add 4950 (99th triangular number) to "this" object's x. If it's a window then that probably means it'll go way off-screen. :kaoswt2:

For the effect you're seeking, you should identify the appropriate update routine (called once per frame) and put your increment code in there. If you want it to happen when the window opens, for instance, you might try aliasing Window_Message.prototype.updateOpen. And remember to be careful of what you're adding/setting the coordinate to~ :p
 

Hyouryuu-Na

Very very lazy
Veteran
Joined
Jun 15, 2017
Messages
1,102
Reaction score
2,888
First Language
Not English
Primarily Uses
RMMV
Edit!
@jjleroy I managed to do it with events. I tested it so it should work for you.
Capture.PNG
Replace '500' with whatever that suits your needs. Don't forget to put it in parallel process.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

I was listening to songs by Chuck E Cheese's voice actor (Jaret Reddick from Bowling for Soup) when the meds I was taking for my stomach virus apparently stopped working. I can't take my next dose until morning, but it's no use anyway. I'm officially sick again. Of course, I'll definitely take the next dose either way, but it's useless now.
New profile picture! This time, it's representative of my current project.
I suddenly feel like making a game for little kids: a pointless sandbox of cute animals, silly collectibles, and random mini games.
Anyone else just like, not bother to make games themed around specific holidays? I know I won't get them done in time for it to make sense.
time to enter the playtest dimension

Forum statistics

Threads
115,990
Messages
1,094,684
Members
151,282
Latest member
zonewebsitesusa
Top