function Window_Debug()
{
this.initialize.apply(this, arguments);
}
Window_Debug.prototype = Object.create(Window_Selectable.prototype);
Window_Debug.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height); // 调用基类 Window_Selectable initialize
}
// 覆盖 SceneMap
var pfnOldSceneMapCreate = Scene_Map.prototype.create;
Scene_Map.prototype.create = function() {
pfnOldSceneMapCreate.call(this);
this.debugWnd = new Window_Debug(0, 0, 400, 200);
// this.addWindow(this.debugWnd);
};
var pfnOldSceneMaponMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function() {
pfnOldSceneMaponMapLoaded.call(this);
this.addWindow(this.debugWnd);
alert(this.debugWnd);
this.ClearDebug();
};
Scene_Map.prototype.DbgPrint = function(str, row) {
alert(this.debugWnd);
this.debugWnd.drawText(str, 0, row * 40, 400, 'left');
};
Scene_Map.prototype.ClearDebug = function(){
this.debugWnd.contents.clear();
this.debugWnd.drawText("debug", 0, 0, 400, 'left');
}
function Window_Debug()
{
this.initialize.apply(this, arguments);
}
Window_Debug.prototype = Object.create(Window_Selectable.prototype);
Window_Debug.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height); // 调用基类 Window_Selectable initialize
}
// 覆盖 SceneMap
var pfnOldSceneMapCreate = Scene_Map.prototype.create;
Scene_Map.prototype.create = function() {
pfnOldSceneMapCreate.call(this);
this.debugWnd = new Window_Debug(0, 0, 400, 200);
// this.addWindow(this.debugWnd);
};
var pfnOldSceneMaponMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function() {
pfnOldSceneMaponMapLoaded.call(this);
this.addWindow(this.debugWnd);
alert(this.debugWnd);
this.ClearDebug();
};
Scene_Map.prototype.DbgPrint = function(str, row) {
alert(this.debugWnd);
this.debugWnd.drawText(str, 0, row * 40, 400, 'left');
};
Scene_Map.prototype.ClearDebug = function(){
this.debugWnd.contents.clear();
this.debugWnd.drawText("debug", 0, 0, 400, 'left');
}