Status
Not open for further replies.

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,587
Reaction score
5,480
First Language
english
Primarily Uses
RMMZ
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. :rswt
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:
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,587
Reaction score
5,480
First Language
english
Primarily Uses
RMMZ
@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.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Winter Cover.png
Peeps, can we just take some time to appreciate the mods here? They're so friendly, and they're always there for us when we need help. Now that I've been here for two years, I want to thank the mods and admins for keeping it positive here on the forum. They're the reason I've stayed so long! Here's to you!
If it gets 6 degrees hotter we've reach 100
I am finally done making the 'superbosses' in my game!
I'm happy because oh my gosh they were a lot of work, but I'm also sad because I love database work... And also because I loved making stupid powerful bosses ._.
Question for anyone who reads Slip into Ruby or Jump into Javascript: do I sometimes get too "explainy" with the methods/functions? Would it be more useful if I stuck to explaining what the code is doing rather than also delving into minutiae of the technical side of it?

Forum statistics

Threads
111,121
Messages
1,058,489
Members
144,343
Latest member
kin_jpg
Top