RPGMV Upload Battler image from SV sprite sheet

Discussion in 'Javascript/Plugin Support' started by TSR, Dec 2, 2019.

Thread Status:
Not open for further replies.
  1. TSR

    TSR The Northern Frog Veteran

    Messages:
    44
    Likes Received:
    19
    Location:
    Canada
    First Language:
    French
    Primarily Uses:
    RMMV
    Hi there!
    I have tuned a bit the Yanfly Status Menu core General section to make some space to add more info.
    See below:

    Capture d’écran 2019-12-01 à 13.00.38.png

    First I would like to draw a static Battler image of the given actor.
    I know that I could use separated Battler images and draw them from the pictures files, but I was wondering if someone knew a way to directly upload an image from the actor battlersheet at a given Index?
    Maybe something like this: var pic = ImageManager.loadSvActor(name) [index???];

    Thanks to anyone willing to share some thoughts on this!
     
    #1
  2. TSR

    TSR The Northern Frog Veteran

    Messages:
    44
    Likes Received:
    19
    Location:
    Canada
    First Language:
    French
    Primarily Uses:
    RMMV
    It was pretty simple after all, using the blt method...
    Work in progress:
    Sans titre3.png

    Functions I added to draw the sprite from Battler sheet:
    Code:
    Window_StatusInfo.prototype.upLoadActorImg = function(actor) {
        let imgId = actor.actorId() - 1;
        let imgList = ['Ray Battler', 'Ken Battler', 'Misty Battler', 'Unknow Actress',
                       'Slim Jo Battler', 'Kay Jin Battler', 'Mic Battler(NPC)', 'Ryna Battler'];
        var bitmap = ImageManager.loadSvActor(imgList[imgId]);
        return bitmap;
    };
    
    Window_StatusInfo.prototype.drawBattlerSprite = function(bitmap) {
        let pw = 64;
        let ph = 64;
        let sx = 0;
        let sy = 0;
        let dw = pw + 24;
        let dh = ph + 24;
        let dx = 340
        let dy = 48
        this.contents.blt(bitmap, sx, sy, pw, ph, dx, dy, dw, dh);
    };
    This thread is solved, thank you!
     
    #2
    zerobeat032 and Shaz like this.
  3. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,749
    Likes Received:
    4,181
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    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.

     
    #3
Thread Status:
Not open for further replies.

Share This Page