Hi all,
I've got a custom scene/window in my menu that i'm using to display an image of the game map to the user. I've noticed though that when I access this item on the menu the whole thing seems to freeze.
I've checked the console and there are no errors, and making it log it's progress shows that it does indeed go through the complete code for this menu option, but nothing shows and I am then unable to do anything. It's almost like the game has crashed or the code is getting stuck somewhere, but i can't see where.
Below is the section of code related to this, if anyone can help that would be very much appreciated.
Many thanks
I've got a custom scene/window in my menu that i'm using to display an image of the game map to the user. I've noticed though that when I access this item on the menu the whole thing seems to freeze.
I've checked the console and there are no errors, and making it log it's progress shows that it does indeed go through the complete code for this menu option, but nothing shows and I am then unable to do anything. It's almost like the game has crashed or the code is getting stuck somewhere, but i can't see where.
Below is the section of code related to this, if anyone can help that would be very much appreciated.
Code:
function Scene_MapBase () {
this.initialize.apply(this, arguments);
};
Scene_MapBase.prototype = Object.create(Scene_MenuBase.prototype);
Scene_MapBase.prototype.constructor = Scene_MapBase;
Scene_MapBase.prototype.initialize = function(){
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_MapBase.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
};
function Scene_Map() {
this.initialize.apply(this, arguments);
}
Scene_Map.prototype = Object.create(Scene_MapBase.prototype);
Scene_Map.prototype.constructor = Scene_Map;
Scene_Map.prototype.initialize = function() {
Scene_MapBase.prototype.initialize.call(this);
};
Scene_Map.prototype.create = function() {
Scene_MapBase.prototype.create.call(this);
this.createMapWindow();
};
Scene_Map.prototype.createMapWindow = function() {
this._mapWindow = new Window_DrawMap();
};
function Window_DrawMap () {
this.initialize.apply(this, arguments);
};
Window_DrawMap.prototype = Object.create(Window_Base.prototype);
Window_DrawMap.prototype.constructor = Window_DrawMap;
Window_DrawMap.prototype.initialize = function(x, y){
var x = 420;
var y = 20;
var width = 350;
var height = 590;
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
Window_DrawMap.prototype.refresh = function(){
this.drawFloorplan();
}
Window_DrawMap.prototype.drawFloorplan = function(){
var bitmap = ImageManager.loadPicture("Floorplan");
this.contents.blt(bitmap, 0, 0, bitmap._canvas.width, bitmap._canvas.height, 0, 0);
};
Many thanks