Moving UI elements (windows specifically)

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
585
Reaction score
329
First Language
English
Primarily Uses
RMMV
Greetings.

Recently I've been trying to get better at some of the things in scripting that I'm not so good at (read: terrible at). I have this test case, where if I can figure out how to do it, I'm going to make a menu transition, where between menus in the game, the individual windows fly off the screen, and the new scene loads the new windows off the screen, and scoots them into frame. Neat idea, right?

Well I can't figure out how to make these windows move a couple of pixels per frame, rather than instantly. I can change x/y positions of windows fine, but the window moves immediately on the frame after those values are changed, there is no slow moving involved. I've seen plugins where some UI elements move around a bit, and I've looked at a few, but I'm not sure where to look to see if I can reverse engineer this for my own use.

Any ideas where to look? Google hasn't been my friend on this one. Any help would be appreciated.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,053
Reaction score
10,282
First Language
Czech
Primarily Uses
RMMV
Changing coords doesn't work like "Slowly move from current position to there". It works like "place there" instead. So what you need to do is to move the windows just by a small portion of the total distance per frame using the update loop.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
585
Reaction score
329
First Language
English
Primarily Uses
RMMV
This update loop, is that the update() function that the windows all have? This updates every frame? Automatically? And I can alias it to just add in something to move it around if I want?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,053
Reaction score
10,282
First Language
Czech
Primarily Uses
RMMV
Yes, yes and yes.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Hey people! What do you think about a core plugin? This will save some lines of code that I repeatedly use in all my plugins...
Wondering if I should make my enemies scale in my non-linear rpg. I'm leaning towards yes, but I don't want to use Yanfly's plugin...
French folk trying to pronounce English words. I loved how the man pronounced squirrel as 'square friend'.
Therapist: any questions? Me: Yeah, are there actually people who think Hotel California is about drugs and not fame or are people just trying to upset me?
Therapist: They WHAT?
It's interesting. There are no safety hazards in our country, but if you look at the shelves in supermarkets, you'd say there's a zombie apocalypse here.

Forum statistics

Threads
94,592
Messages
922,145
Members
124,461
Latest member
ppkvvet
Top