// Metodo di inizializzazione per il GabWindow
function GabWindow() {
this.initialize.apply(this, arguments);
}
GabWindow.prototype.initialize = function(x, y, width, height, color, text) {
// Imposta le opzioni del GabWindow
this._x = Number(x) || 0;
this._y = Number(y) || 0;
this._width = Number(width) || 400;
this._height = Number(height) || 100;
this._color = color || "white";
this._text = text || "";
// Inizializza le proprietà del GabWindow
this._faceName = "";
this._faceIndex = 0;
this._spriteName = "";
this._spriteIndex = 0;
this._actorId = 0;
this._endSwitchId = 0;
// Crea l'elemento HTML del GabWindow
this.createWindow();
// Aggiorna la posizione del GabWindow
this.setPosition(this._x, this._y);
};
// Metodo per impostare la posizione del GabWindow
GabWindow.prototype.setPosition = function(x, y) {
// Imposta le nuove coordinate del GabWindow
this._x = Number(x) || 0;
this._y = Number(y) || 0;
// Aggiorna la posizione del GabWindow sullo schermo
this.updatePlacement();
};
// Aggiungi i parametri editabili nell'editor di RPG Maker MV
/*:
* @param X
* @text X Position
* @desc The X position of the GabWindow.
* @type number
* @default 0
*
* @param Y
* @text Y Position
* @desc The Y position of the GabWindow.
* @type number
* @default 0
*
* @param Width
* @text Width
* @desc The width of the GabWindow.
* @type number
* @default 400
*
* @param Height
* @text Height
* @desc The height of the GabWindow.
* @type number
* @default 100
*
* @param Color
* @text Color
* @desc The color of the GabWindow background.
* @type select
* @option White
* @value white
* @option Blue
* @value blue
* @option Green
* @value green
* @default white
*
* @param Text
* @text Text
* @desc The initial text to display in the GabWindow.
* @type note
* @default ""
*/
// Funzione che legge i parametri editabili dall'editor di RPG Maker MV
GabWindow.prototype.readParams = function(params) {
this._x = Number(params["X"]) || 0;
this._y = Number(params["Y"]) || 0;
this._width = Number(params["Width"]) || 400;
this._height = Number(params["Height"]) || 100;
this._color = params["Color"] || "white";
this._text = params["Text"] || "";
};