- Joined
- Nov 12, 2018
- Messages
- 78
- Reaction score
- 12
- First Language
- Russian
- Primarily Uses
- Other
So I was able to create a selectable window but I cant activate it or draw anything on it
It's just a blank window, I cant choose options or do anything with that window and the highlighted option isn't flashing
When I type "SceneManager._scene._menuSelectable.show()" in the console window appears on the screen as it supposed to
but when I type"SceneManager._scene._menuSelectable.activate()" nothing happens
I used this script
It's just a blank window, I cant choose options or do anything with that window and the highlighted option isn't flashing
When I type "SceneManager._scene._menuSelectable.show()" in the console window appears on the screen as it supposed to
but when I type"SceneManager._scene._menuSelectable.activate()" nothing happens
I used this script
if anyone has an idea why it isn't working please help!function MyWindow() {
this.initialize.apply(this, arguments);
}
MyWindow.prototype = Object.create(Window_Base.prototype)
MyWindow.prototype.constructor = MyWindow;
MyWindow.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, 220, 0, Graphics.boxWidth - 220, Graphics.boxHeight);
this.drawAllItems();
}
MyWindow.prototype.drawAllItems = function() {
this.contents.clear();
this.drawText(Dimeon.Windows.text, 0, 0, Graphics.boxWidth, 48, 'center');
}
// ------------------------------
function MenuScene() {
this.initialize.apply(this, arguments);
}
MenuScene.prototype = Object.create(Scene_MenuBase.prototype)
MenuScene.prototype.constructor = MenuScene;
MenuScene.prototype.initialize = function(x, y, width, height) {
Scene_MenuBase.prototype.initialize.call(this, 0, 0, Graphics.boxWidth, Dimeon.Windows.lh);
}
MenuScene.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._myScene = new MyWindow(0, 0, 320, 240);
this.addChild(this._myScene);
this._menuSelectable = new MenuSelectable(0, 0, 100, 100);
this._menuSelectable.hide();
this._menuSelectable.select(0);
this._menuSelectable.setHandler("ok", this.commandOk.bind(this));
this._menuSelectable.setHandler("cancel", this.commandCancel.bind(this));
this.addChild(this._menuSelectable);
}
MenuScene.prototype.commandOk = function() {
this._menuSelectable.activate();
SoundManager.playOk();
}
MenuScene.prototype.commandCancel = function() {
SceneManager.pop();
SoundManager.playCancel();
}
MenuScene.prototype.update = function() {
if (!this.drawnWindows){
this._myScene.drawAllItems();
this.drawnWindows = true;}
if (Input.isTriggered("cac")){ SceneManager.pop();
SoundManager.playCancel();
}
};
//===========
function MenuSelectable() {
this.initialize.apply(this, arguments);
}
MenuSelectable.prototype = Object.create(Window_Selectable.prototype)
MenuSelectable.prototype.constructor = MenuSelectable;
MenuSelectable.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.boxWidth, Dimeon.Windows.lh * 2);
this.refresh();
this.hide();
this._index = -1;
this._cursorFixed = false;
this._cursorAll = false;
this._stayCount = 0;
this._helpWindow = null;
this._handlers = {};
this._touching = false;
this._scrollX = 0;
this._scrollY = 0;
}
Window_Selectable.prototype.refresh = function(){
this.drawAllItems();
}
Window_Selectable.prototype.drawAllItems = function() {
var topIndex = this.topIndex();
for (var i = 0; i < this.maxPageItems(); i++) {
var index = topIndex + i;
if (index < this.maxItems()) {
this.drawItem(index);
}
}
};
Window_Selectable.prototype.maxPageRows = function() {
return 3;
}
Window_Selectable.prototype.maxItems = function() {
return 2;
}
Window_Selectable.prototype.itemHeight = function() {
return (this.height - this.padding * 2) / this.maxPageRows();
}
Window_Selectable.prototype.maxPageItems = function () {
return this.maxPageRows() * this.maxCols();
}
Window_Selectable.prototype.drawItem = function(index) {
var itemRect = this.itemRect(index);
this.drawText("text", itemRect.x, itemRect.y, itemRect.width / 2, itemRect.height / 2, 'center');
this.drawTextEx("saddsa", 0, 0);
this.drawFace("Actor2", 1 + index, itemRect.x, itemRect.y, itemRect.width / 2, itemRect.height / 2);
};
