Move picture by percentage/ certain number of pixels

I need a move picture command that moves a certain percentage each time you call it rather than specific coordinates.

I don't mind if its script instead of a plugin
Oh man, pictures are annoying to call in script.
I have a plugin that is NOT yet available for release (and my never be) that does this and a bunch of other stuff with pictures.
Here's the call to show a picture, with the arguments named
$gameScreen.showPicture(picturedId, name, origin, x, y, scaleX, scaleY, opacity, blendMode)

Here's the call to move a picture, with the arguments named
$gameScreen.movePIcture(pictureId, origin, x, y, scaleX, scaleY, opacity, blendMode, duration)

If you want to use percentages, then you should have variables, set aside for an x and a y coordinate.
Each time you show or move the picture, replace the coordinates with the variables that hold x and y.

You can easily increment the variables by percentage, a number of ways.
The thing is, calling game variables in code is long, too.
Here's what a completed call may look like:

$gameScreen.showPicture("Sword", 0, $gameVariables.value(1), $gameVariables.value(2), 100, 100, 255, 0)

It's a pain to type, and the more you type the more you risk mistakes, and then headaches.

But there, the best way to honestly do it is to have a place to keep track of the x and y, and use those as the arguments when you show or move the picture.
This will allow you to do any kind of math you want very easily, including working with percentages without inline math
This might work. But given the ballache I might just forgo a more efficient method in favour of something similar. I.e using variables to call screen x and y and subtracting and adding onto those variables as and when it needs to. I suppose the only upside with a percentage method is better clarity
As long as it works ^^ But you know you could the percentages easily from the event menu.
Select the variable, choose Mul (for multiply, of course)
and then instead of a hardcoded value, you click the script box and write, for example
1.25

And that would multiply the variable's percentage by 25%

I only say so since it sounds like you'll be using the event editor for variables
As long as it works ^^ But you know you could the percentages easily from the event menu.
Select the variable, choose Mul (for multiply, of course)
and then instead of a hardcoded value, you click the script box and write, for example
1.25

And that would multiply the variable's percentage by 25%

I only say so since it sounds like you'll be using the event editor for variables
Oh wow this made me feel dumb! Thank you!
No worries lol don't feel dumb, I once spent a half hour hunting through event codes to figure out why whenever I moved my character's starting location, he would start as Transparent. Which is what happens when you enable 'Start Transparent' in the System tab. ><
Glad I could help
You can use my plugin, Move Picture - Extended, to make this a lot easier for yourself, as it allows you to use variables with all the properties of move picture, as well as relative values. It also (optionally) allows you to use animation curves for properties, as it integrates with another plugin of mine.

Hope you find it useful 🙂
I don't know if I have to start a new thread for this but I don't want to spam the forum. But are there any ways or plugins to get animations such as the battle ones to play on top of pictures?

Original thread: https://forums.rpgmakerweb.com/threads/move-picture-by-percentage-certain-number-of-pixels.110359/