MV Move Picture Scale + Rotation by variable

Hey!

I want to be able to move and show pictures, specifically their rotation and scale using variables. So I could set variable 1 to 180 and it'd rotate the picture by 180 degrees. I want to be able to do the same for a pictures scale, both width and height.

Thanks in advance!

EDIT: As a side thing, it'd be nice if I could also be able to anchor the picture to a specific place as well as do the above, but I'd rather the first two things be solved first.
The following examples are for use in a Script command~

Set picture 1's rotation speed to 4 (i.e. +2° clockwise per frame):
JavaScript:
$gameScreen.picture(1).rotate(4);
Set picture 1's current angle to 90° (clockwise):
JavaScript:
$gameScreen.picture(1)._angle = 90;
Remember that all rotations are done about the picture's current origin.

Set picture 1's X scale (horizontal) to 50%:
JavaScript:
$gameScreen.picture(1)._scaleX = 50;
Transition picture 1's X scale to 50% over 60 frames or the current move duration, whichever is longer:
JavaScript:
var picture = $gameScreen.picture(1);
picture._targetScaleX = 50;
if (picture._duration < 60) picture._duration = 60;
If scaling is in progress, this will replace the current target X scale value.

Y scaling (vertical) can be done similarly, just use Y instead of X, e.g.
JavaScript:
$gameScreen.picture(1)._scaleY = 50;
For any of these, you can replace the fixed number(s) with a variable reference, e.g.
JavaScript:
$gameScreen.picture(1)._angle = $gameVariables.value(5);

Changing the anchor will require a plugin due to the way picture anchors are handled.

Original thread: https://forums.rpgmakerweb.com/threads/move-picture-scale-rotation-by-variable.139712/