Moving UI elements (windows specifically)

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
570
Reaction score
320
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,038
Reaction score
10,258
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
570
Reaction score
320
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,038
Reaction score
10,258
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

Yeseylon wrote on ct_bolt's profile.
First language: Javascript.

Me: Is... is this a sentient AI???
"Got your game? Cause its time to duel!"

I'm so into YuGiOh these days...
(And of course the hand is awful)
Been working on this new character for the battle system It's BOSS time!
Happy Year of the Rat all! Wish everyone can achieve their dream this year
Please support my Lego Ideas Untitled Goose Game set, thanks in advance :) https://ideas.lego.com/projects/2bcb743a-1071-4f44-89f4-97ad6ec27b5d

Forum statistics

Threads
93,585
Messages
913,717
Members
123,128
Latest member
Stimulai
Top