RPG Maker Forums

Howdy!

After some help with menus, I though I had a good understanding of them, however, this is clearly not the case so here I am.

My goal is just to make a window popup with text. Right now the error comes up when I try to create the window.

Here's my error and code:

Code:
TypeError: Cannot read property 'addChild' of undefined
Code:
//There is no need for this to be declared becasue the interpreterCommand from ResistanceIsFeudalGameStart.
//var interpreterCommand = Game_Interpreter.prototype.pluginCommand;

Game_Interpreter.prototype.pluginCommand = function(command, args) {
    interpreterCommand.apply(this);
    if (command === 'endScreen') {
        Scene_Map.prototype.createEndWindow();
    };
};

Scene_Map.prototype.createEndWindow = function() {
    this._endWindow = new Window_End(0, 0);
    this._endWindow.x = 10;
    this._endWindow.y = 10;
    //if (true) {
        this._endWindow.drawText ("Ending 1 text", 0, 0, 0, 'left' );
    //}
    Scene_Base.prototype.addWindow(this._endWindow);
};

function Window_End() {
    this.initialize.apply(this, arguments);
};

Window_End.prototype = Object.create(Window_Base.prototype);
Window_End.prototype.constructor = Window_End;

Window_End.prototype.initialize = function(x, y) {  
    var width = this.windowWidth();
    var Height = this.windowHeight();
    Window_Base.prototype.initialize.call(this, x, y, width, Height);
};

Window_End.prototype.windowWidth = function() {
    return Graphics.boxWidth - 20;
};

Window_End.prototype.windowHeight = function() {
    return Graphics.boxHeight - 20;
};
Thanks for helping!

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top