RPGMV Upload Battler image from SV sprite sheet

Status
Not open for further replies.

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
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!
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
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!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,584
Latest member
Faustus2501
Top