Moving UI elements (windows specifically)

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
704
Reaction score
429
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,122
Reaction score
10,614
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
704
Reaction score
429
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,122
Reaction score
10,614
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

X[ oh gawd.... I dropped my super expensive laptop on my hard tile floor! It still comes on and all, but now Im worried its gunna start screwing up in the near future.... I hope not, cant afford to replace stuff like that. :(
I wrote a nice animated preloading system for mv+mz today. It only supports graphic assets atm, should it support audio too? See it in action in my recent minigame @
I posted my first commercial game on the forums, and now waiting for approval.
fingers crossed.
TMW the air quality is so bad, your hair changes color every time you wash it. :LZYyuck:
Finished two animations today. :kaojoy:

Forum statistics

Threads
103,000
Messages
996,636
Members
134,484
Latest member
Gesonel
Top