[Solved!] Menu background that changes as the story progress

😅 This is my first post here, so if I'm in the wrong category, please correct me.

I'm hoping to accomplish something that looks like this:
Spoiler: Reference 1
Screenshot (470).png

Once you click an option, the menu becomes see-through and the map is visible in behind:
Spoiler: Reference 2
Screenshot (471).png

As story progression is made, the menu background adapts:
Spoiler: Reference 3
Screenshot (472).png

The screenshots were taken from the game ZENO Remake by 丸得基地.
They made their game in VX ACE, but I'm using MV.
I'm struggling to figure out how they did this. I want to add images to the menu that change over time.
I appreciate any help, thank you very much! 🙏
My first language is German..
Create a file in yourGame/js/plugins, give it any name, and type this:

JavaScript:
Scene_MenuBase.prototype.createBackground = function() {
    
    let pictureName = null;
    
    if ($gameVariables.value(1) == 1) {
        pictureName = "Picture1";
    }
    if ($gameVariables.value(1) == 2) {
        pictureName = "Picture2";
    }
    if (!pictureName) {
        // This is the fallback image when the code doesn't know which to show
        pictureName = "ErrorPicture";
    }
    
    const bitmap = ImageManager.loadPicture(pictureName);
    this._backgroundSprite = new Sprite(bitmap);
    
    // stretch picture to screen size
    bitmap.addLoadListener(() => {
        this._backgroundSprite.scale.x = Graphics.width / bitmap.width;
        this._backgroundSprite.scale.y = Graphics.height / bitmap.height;
    });
    
    this.addChild(this._backgroundSprite);
}

Put your Pictures into "img/Pictures", and update the IDs in the "gameVariables" commands.
@Aerosys
Thank you very much! it works perfectly 😂
another way to simplify is this way:
JavaScript:
Scene_MenuBase.prototype.createBackground = function() {
    let pictureName = $gameVariables.value(1);
    if (pictureName !== null || pictureName !== undefined) {
        pictureName = $gameVariables.value(1);
    }
    const bitmap = ImageManager.loadPicture(pictureName);
    this._backgroundSprite = new Sprite(bitmap);
    
    // stretch picture to screen size
    bitmap.addLoadListener(() => {
        this._backgroundSprite.scale.x = Graphics.width / bitmap.width;
        this._backgroundSprite.scale.y = Graphics.height / bitmap.height;
    });
    this.addChild(this._backgroundSprite);
}

this way, if you variable 1 = "Background_1" it draws that picture,
if variable 1 = "Background_2" it takes that name.

there are ways to make it nice and clean.
I don't think addloadListener is required, but doesn't hurt to add anyway.
if its preloaded, you mostly can leave it out. (depends on the feature)
This thread is closed due to being marked as solved. Using the report function next time will make this easier to spot. If you need the thread reported, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/solved-menu-background-that-changes-as-the-story-progress.173860/