MV How to add still images and animations to RPG Maker MV scenes?

Please help me learn how to do so. I know some of RMMV JS plugin development and have created my own plugins but I don't know how to add still images and animations to scenes. I would want my game to have changing animated types of auras for the battlers and when some guard for a shield to be on some battlers sometimes or appear in front of them spontaneously. What functions can I use for these and how do I use them with examples? Thanks in advance.
Not sure what you mean, but you can add sprites to the scene, move them, hide or show them, etc. Usually that does the trick.

this._sprite = new Sprite()
this.addChild(this._sprite)
this._sprite.hide()
this._sprite.show()
First you need a source bitmap. This is typically an image loaded from file, e.g.
JavaScript:
var bmp = ImageManager.loadTitle1($dataSystem.title1Name);
Once you have that bitmap, the 2 usual options are either:
  1. Use it as a new Sprite (like MushroomCake says):
    JavaScript:
    var sprite = new Sprite(bmp);
    This is a wrapper for PIXI.Sprite, which has a bunch of handy features and optimisations. Sprites refresh themselves when necessary, e.g. once the bitmap is done loading from disk.

    To make it display, just add it to a parent display object, e.g. (rpg_scenes.js):
    JavaScript:
    Scene_Title.prototype.createBackground = function() {
        this._backSprite1 = new Sprite(ImageManager.loadTitle1($dataSystem.title1Name));
        this._backSprite2 = new Sprite(ImageManager.loadTitle2($dataSystem.title2Name));
        this.addChild(this._backSprite1);
        this.addChild(this._backSprite2);
    };

  2. Alternatively, block-transfer (a.k.a. "blit") it to an existing canvas/sprite. This is what the core scripts do with icons and face images, e.g. (rpg_windows.js):
    JavaScript:
    Window_Base.prototype.drawIcon = function(iconIndex, x, y) {
        var bitmap = ImageManager.loadSystem('IconSet');
        var pw = Window_Base._iconWidth;
        var ph = Window_Base._iconHeight;
        var sx = iconIndex % 16 * pw;
        var sy = Math.floor(iconIndex / 16) * ph;
        this.contents.blt(bitmap, sx, sy, pw, ph, x, y);
    };
    This involves painting the source image to the destination, pixel-by-pixel. It can be a useful option in some cases, but typically you'd just use a Sprite instead.

    Note that you need the image to be ready/loaded before you blit. RMMV's Bitmap wrapper includes a load listener structure that can be used for this purpose, e.g.
    JavaScript:
    var x = 50, y = 50;
    var destination = this.contents;  // Window_Base#contents
    bmp.addLoadListener(function(bitmap) {
      destination.blt(bitmap, 0, 0, bitmap.width, bitmap.height, x, y);
    });
The Bitmap and Sprite wrappers are both defined in rpg_core.js.
Okay those are helpful guys. Those are for still images but how do I create, setup, and add a custom (non-skill) animated image object like an aura to a battler, to a game scene? What functions should I use with example?
You have multiple ways to do it.

You can either have an existing animation that can loop and just play it over and over on top of your battler, or you get an animation sheet and make the sprite scroll through the sheet. By default the bitmap of a sprite will be the entire image, but if is possible to set a frame so it will only display part of the image. You can use this to do that:

this._sprite.setFrame(x, y, width, height);

By doing this, you can periodically shift the frame to another part of the image which contains the next frame of the animation, thus achieving an animation sprite. This is how animations are done in RPG Maker prior to RPG Maker MZ.
To expand on that a bit: pretty much every game object (battlers, game windows, scenes, etc) has an update method. This method gets called every frame, so you can set up a frame counter and update the sprite's bitmap every X frames, e.g. (rpg_sprites.js):
JavaScript:
Sprite_StateIcon.prototype.update = function() {
    Sprite.prototype.update.call(this);
    this._animationCount++;
    if (this._animationCount >= this.animationWait()) {
        this.updateIcon();
        this.updateFrame();
        this._animationCount = 0;
    }
};
The updateFrame here basically just calls setFrame with the appropriate coordinates.
Just to put it out there, there are also already existing plugins to do this without you having to learn it on your own.


Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-still-images-and-animations-to-rpg-maker-mv-scenes.152506/