Block transferring an image onto Show Picture

Hello! I'm trying to make it so that when I show a picture using the Show Picture function, it'll automatically block transfer another image onto it (combining to make it one image.) I need it to be one image so that I can show battle animations on it (so I can't just layer 2 pictures on top of one another, as the flash from a battle animation will only affect one part.)

This is what I came up with, which doesn't work.

Code:
Sprite_Picture.prototype.loadBitmap = function() {
    this.bitmap = ImageManager.loadPicture(this._pictureName);
    var source = ImageManager.loadPicture('Picture to add');
    this.bitmap.blt(source, 10, 20, 50, 50, 0, 0); //this doesn't work???
};

Any insights as to what I'm doing wrong/how to make this work? One suggestion I found was to use addLoadListener(), but I haven't had much success making that work either.
When you say "this doesn't work" can you please explain what you expect to happen, but more importantly, what IS happening?

You would only want to do the above if you are only ever showing that one combined picture, otherwise it's going to affect every other picture you want to show.
When you say "this doesn't work" can you please explain what you expect to happen, but more importantly, what IS happening?

You would only want to do the above if you are only ever showing that one combined picture, otherwise it's going to affect every other picture you want to show.


Sure, sorry. With the above code, nothing changes as far as I can tell. The Show Picture command seems to work as it did before, just showing the assigned picture without anything being blocked transferred onto it.


What I expected to happen, was for part of 'Picture to add' to be blocked transferred to the assigned picture, resulting in one picture showing 'Picture to add' overlapped on top of assigned picture.

Thanks, I get that the code above will affect every picture. My intentions right now is just to get block transfer working correctly. After that, I plan to add conditional cases so that it only affect certain pictures.

(Related, just now I tried switching blt to a blur function as a test, and that didn't do anything either. Picture just shows as is, non-blurred)
Code:
Sprite_Picture.prototype.loadBitmap = function() {
    this.bitmap = ImageManager.loadPicture(this._pictureName);
    var source = ImageManager.loadPicture('Picture to add');
    this.bitmap.blur() //This doesn't work either.
};
You can't block transfer on to the currently drawn bitmap, I'm pretty sure it will always draw beneath it or it just gets lost in the context somewhere lol. What you need to do is create a sprite and add it as a child . It not only saves time, CPU usage and headaches but it's really the best way of doing it.

Now doing it within the function you're using, my guess would be as simple as this. The x and y coordinates may need to be adjusted but that's easy to do.

PHP:
Sprite_Picture.prototype.loadBitmap = function () {
  this.bitmap = ImageManager.loadPicture(this._pictureName);
  const source = ImageManager.loadPicture('Picture to add');
  const sprite = new Sprite(source)
  //sprite.x = 0
  //sprite.y = 0
  this.addChild(sprite)
};
You can't block transfer on to the currently drawn bitmap, I'm pretty sure it will always draw beneath it or it just gets lost in the context somewhere lol. What you need to do is create a sprite and add it as a child . It not only saves time, CPU usage and headaches but it's really the best way of doing it.

Now doing it within the function you're using, my guess would be as simple as this. The x and y coordinates may need to be adjusted but that's easy to do.

PHP:
Sprite_Picture.prototype.loadBitmap = function () {
  this.bitmap = ImageManager.loadPicture(this._pictureName);
  const source = ImageManager.loadPicture('Picture to add');
  const sprite = new Sprite(source)
  //sprite.x = 0
  //sprite.y = 0
  this.addChild(sprite)
};

Thanks. Yeah, I guess it doesn't work the same way as it does in Ace, which is a huge bummer. Your method works for getting the picture added, but still treats it as two separate images, so that's a no go unfortunately.

I'll try experimenting more with the blt function later.

Original thread: https://forums.rpgmakerweb.com/threads/block-transferring-an-image-onto-show-picture.102789/