Hello there, so I was doing a tutorial to learn the maker programmation, and at a moment in the tutorial than I watched. I fall on a error , in the dev tool (f8) this is the message :
TypeError: Cannot read property 'apply' of undefined
at Window_Custom (tutoMenu.js:28)
at Scene_CustomMenu.create (tutoMenu.js:14)
the tutorial :
My code :
function Scene_CustomMenu() {
this.initialize.apply(this, arguments);
}
Scene_CustomMenu.prototype = Object.create(Scene_MenuBase.prototype);
Scene_CustomMenu.prototype.constructor = Scene_CustomMenu;
Scene_CustomMenu.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_CustomMenu.prototype.create = function(){
Scene_MenuBase.prototype.create.call(this);
this._customWindow = new Window_Custom(0, 0, 320, 240);
this.addWindow(this._customWindow);
}
Scene_CustomMenu.prototype.update() = function(){
if(!this.drawnWindows){
this._customWindow.drawAllItems();
this.drawnWindows = true;
}
}
function Window_Custom() {
console.log(arguments);
this.initialize.apply(this, arguments);
}
Window_Custom.prototype = Object.create(Window_Base.prototype);
Window_Custom.prototype.constructor = Window_Custom;
Window_Custom.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.drawAllItems();
};
Thanks you so much if you can solve my problem.
TypeError: Cannot read property 'apply' of undefined
at Window_Custom (tutoMenu.js:28)
at Scene_CustomMenu.create (tutoMenu.js:14)
the tutorial :
My code :
function Scene_CustomMenu() {
this.initialize.apply(this, arguments);
}
Scene_CustomMenu.prototype = Object.create(Scene_MenuBase.prototype);
Scene_CustomMenu.prototype.constructor = Scene_CustomMenu;
Scene_CustomMenu.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_CustomMenu.prototype.create = function(){
Scene_MenuBase.prototype.create.call(this);
this._customWindow = new Window_Custom(0, 0, 320, 240);
this.addWindow(this._customWindow);
}
Scene_CustomMenu.prototype.update() = function(){
if(!this.drawnWindows){
this._customWindow.drawAllItems();
this.drawnWindows = true;
}
}
function Window_Custom() {
console.log(arguments);
this.initialize.apply(this, arguments);
}
Window_Custom.prototype = Object.create(Window_Base.prototype);
Window_Custom.prototype.constructor = Window_Custom;
Window_Custom.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.drawAllItems();
};
Thanks you so much if you can solve my problem.