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,050
Reaction score
10,279
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,050
Reaction score
10,279
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

Just finished planning out the skeleton of the main quest line of my new game. I'm so excited for it!
Integrating Jason Perry's japan tile set while listening to Murray Atkinson's Heaven and Earth background music.
I forgot I had an account on rpgmakercentral lol
"What do you think the best place to visit on this cold days?" "Hell..."
Been so busy lately that I wonder if I should slowly start preparing the advent calendar resources so I have enough in december.

Forum statistics

Threads
94,538
Messages
921,726
Members
124,403
Latest member
yeriano
Top