Smoothly Move Windows

Hello, everybody.


I am working on the interface of my game, and I tried to find a way to smoothly move windows from a position to another, but I could not manage it. I tried the love method, but it performs an instantaneous translation, which is not what I need. So now I ask you if you know how to move a window smoothly. Thank you in advance 🙂
Well, I can't give any advice about loving a window smoothly, but moving it smoothly would need to be done in it's update method.


You set the destination position fro the window somewhere (this depends on when you want to start the moving), and as soon as a destination is set, the window can start to move.


In the window's update method, you make the movement logic.
First check if there is a destination.


If there is, you add a value for the window's X and/or Y position. The value you add here will be the actual speed of the movement, so the higher it is, the quicker it will be.


After this, you check if the window reached the destination or not.


If it reached the destination (or moved more), you set the window's X and/or Y position to the destination co-ordinates (in case the window moved too much), and set the destination to nil (which disables the movement until another destination is given).


This would be it in a nutshell.


You can also make time based speed formulas with a bit of math and logic if needed.


I assume you plan to make your own script for this, right?


Because of the way how you wrote, that's what I figured, but you posted in the script request section, so I'm not sure about it. 
@SixthThank you, I didn't think about that solution (and sorry for the writing error). Annnd I think I poster in the wrong section, because I did not want a script but an advice like the one you gave me. My mistake.

Original thread: https://forums.rpgmakerweb.com/threads/smoothly-move-windows.66245/