MZ Add new picture origin options with plugin commands

Hey all, thanks for taking the time to check out this thread. I'm looking for a plugin that gives me more options when it comes to choosing a picture's origin. The default lets us choose from the upper left and center of a picture, which is fine but I was hoping to use the bottom corners to make it easier to place busts at the edge of the screen. And once I thought about using the bottom corners as an origin, I thought that adding a few more could be possible too.
So instead of the two default origins like this:
default picture origins.png

I'm hoping for a plugin that would let me pick from nine origin options like this:
added picture origins.png


I found this code in the rmmz_sprites code that I think is what controls the default commands picture origin, but that's where my javascript knowledge ends. 😅
Code:
Sprite_Picture.prototype.updateOrigin = function() {
    const picture = this.picture();
    if (picture.origin() === 0) {
        this.anchor.x = 0;
        this.anchor.y = 0;
    } else {
        this.anchor.x = 0.5;
        this.anchor.y = 0.5;
    }
};
I was thinking the plugin could use plugin commands to give those new origin options alongside the rest of the normal Show Picture and Move Picture details (the stuff like position, scale, blend, duration) so that's it's easier to use than needing to make sure a script call is written correctly each time.
I hope that's enough details to get someone started, but if you need more info let me know. Thanks in advance. :ptea:
Hi there!
This a nice feature indeed. I have a plugin that extends a lot of things for show/move pictures.
I will add this feature into it 🙂
https://hakuenstudio.itch.io/eli-enhanced-pictures
Hi there!
This a nice feature indeed. I have a plugin that extends a lot of things for show/move pictures.
I will add this feature into it 🙂
https://hakuenstudio.itch.io/eli-enhanced-pictures
Can you make it compatible for MV too? 😍😅
Can you make it compatible for MV too? 😍😅
Got it! 😀
Awesome to hear, thanks @Eliaquim! Your plugin looks neat already, I'm looking forward to the update. 😉
@hiddenone it's done, take a look
@Eliaquim Thank you so much! It seems to be working perfectly, this is going to save me (and hopefully others) from having to do a lot of extra math to get pictures to show up in the right spots.
Now I just need to make the rest of the game...

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/add-new-picture-origin-options-with-plugin-commands.133668/