Move Picture by set distance?

Hello!
In the normal 'Move Picture' command, it is possible to move a picture to a set coordinate, either through a designation, or by variables.

1621977903302.png


What I'm looking for instead is the ability to move the picture relative to its current position.
(ex: x++20, y+-35)
Is there a script call to pull this off?
Thanks!
You can do it fairly easily through variables: when you first set a picture, store the x and y to separate variables.
$gameVariables.setValue(1,100)
$gameVariables.setValue(2,100)

then before moving the picture, add/subtract the amount you want to move the picture, to those variables.
$gameVariables.setValue(1,$gameVariables.value(1)+20)
$gameVariables.setValue(2,$gameVariables.value(2)-35)

then use the 'Designate with Variables' option, which would be 1 and 2 in the above case.

EDIT: Script alternative


The current pictures location is stored @
$gameScreen._pictures[80]._x
$gameScreen._pictures[80]._y

The move pictures command is
$gameScreen.movePicture(pictureId, origin, x, y, scaleX, scaleY, opacity, blendMode, duration)

so to move picture 80 by the variables you offered would be:
$gameScreen.movePicture(80, 1, $gameScreen._pictures[80]._x+20, $gameScreen._pictures[80]._y-35, 100, 100, 255, 0, 10)
You don't need scripting for this, e.g.
Code:
◆Comment:Store starting picture coordinates in variables
◆Control Variables:#0002 pic x = 50
◆Control Variables:#0003 pic y = 50

◆Comment:Show picture at those coordinates
◆Show Picture:#1, picture, Upper Left ({pic x},{pic y}), (100%,100%), 255, Normal

◆Comment:Move -> by 100 px over 60 frames
◆Control Variables:#0002 pic x += 100
◆Move Picture:#1, Upper Left ({pic x},{pic y}), (100%,100%), 255, Normal, 60 frames (Wait)

Original thread: https://forums.rpgmakerweb.com/threads/move-picture-by-set-distance.136828/