Scale picture plugin

I know RPG maker MV has an inbuilt system to make a picture bigger or smaller but it only works via set percentages.

Is there anyway to make it so everytime the event passes by the same command it'll make the picture gradually bigger and bigger?

i.e

Show Picture #1 > Plugin: Enlarge picture by- 10% > Picture grows in size > The event loops back to this again and makes the picture even bigger by another 10% second time around

I could do this with variables and conditional branches, but it'd be time-consuming and long-winded (and have to make it near infinite)
This script call seems to work, at least on the map:
Code:
var id = 1, duration = 5, scaleMult = 1.05;
var pic = $gameScreen.picture(id);
pic._duration = duration;
pic._targetScaleX = pic.scaleX() * scaleMult;
pic._targetScaleY = pic.scaleY() * scaleMult;
I've defined it in terms of three variables so you should only have to edit the values in the topmost line. id is the ID of the picture to scale, duration should be matched to the wait interval on your loop, and scaleMult is how much larger the image should become every loop. =)

My full test event, if needed for reference:
Spoiler
Code:
◆Show Picture:#1, theFace, Center (408,312), (20%,20%), 255, Normal
◆Control Variables:#0001 Counter = 30
◆Loop
  ◆Script:var id = 1, duration = 5, scaleMult = 1.05;
  :      :var pic = $gameScreen.picture(id);
  :      :pic._duration = duration;
  :      :pic._targetScaleX = pic.scaleX() * scaleMult;
  :      :pic._targetScaleY = pic.scaleY() * scaleMult;
  ◆Wait:5 frames
  ◆Control Variables:#0001 Counter -= 1
  ◆If:Counter = 0
    ◆Break Loop
    ◆
  :End
  ◆
:Repeat Above
This script call seems to work, at least on the map:
Code:
var id = 1, duration = 5, scaleMult = 1.05;
var pic = $gameScreen.picture(id);
pic._duration = duration;
pic._targetScaleX = pic.scaleX() * scaleMult;
pic._targetScaleY = pic.scaleY() * scaleMult;
I've defined it in terms of three variables so you should only have to edit the values in the topmost line. id is the ID of the picture to scale, duration should be matched to the wait interval on your loop, and scaleMult is how much larger the image should become every loop. =)

My full test event, if needed for reference:
Spoiler
Code:
◆Show Picture:#1, theFace, Center (408,312), (20%,20%), 255, Normal
◆Control Variables:#0001 Counter = 30
◆Loop
  ◆Script:var id = 1, duration = 5, scaleMult = 1.05;
  :      :var pic = $gameScreen.picture(id);
  :      :pic._duration = duration;
  :      :pic._targetScaleX = pic.scaleX() * scaleMult;
  :      :pic._targetScaleY = pic.scaleY() * scaleMult;
  ◆Wait:5 frames
  ◆Control Variables:#0001 Counter -= 1
  ◆If:Counter = 0
    ◆Break Loop
    ◆
  :End
  ◆
:Repeat Above

Works perfectly, you're a star thank you <3

Original thread: https://forums.rpgmakerweb.com/threads/scale-picture-plugin.97657/