【解決済み】ショップの売買ウインドウのX軸をプラグインで変更したい
Posted: 2025年1月01日(水) 11:52
画像の赤く囲まれているウインドウを、赤い矢印の方向にプラグインで移動出来る様にしたい。
問題点:
このウインドウはX軸が固定されているので、それを動く様にしたいがそれが出来ていない。
やってみた事:
コアスプリクトを弄ってみた。
の部分を
に変更したらウインドウの位置が変化しました。
それを踏まえて下記のプラグインを書きました。
しかしこれでウインドウのY軸以外は変更出来たモノの、Y軸は動きませんでした。
何が問題なのか私には分かりませんので、どなたかウインドウのY軸の動かし方を御教え頂けませんか。
問題点:
このウインドウはX軸が固定されているので、それを動く様にしたいがそれが出来ていない。
やってみた事:
コアスプリクトを弄ってみた。
コード: 全て選択
Scene_Shop.prototype.createCommandWindow = function() {
const rect = this.commandWindowRect();
this._commandWindow = new Window_ShopCommand(rect);
this._commandWindow.setPurchaseOnly(this._purchaseOnly);
this._commandWindow.y = this.mainAreaTop();
this._commandWindow.setHandler("buy", this.commandBuy.bind(this));
this._commandWindow.setHandler("sell", this.commandSell.bind(this));
this._commandWindow.setHandler("cancel", this.popScene.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Shop.prototype.commandWindowRect = function() {
const wx = 0;
const wy = this.mainAreaTop();
const ww = this._goldWindow.x;
const wh = this.calcWindowHeight(1, true);
return new Rectangle(wx, wy, ww, wh);
};
コード: 全て選択
Scene_Shop.prototype.createCommandWindow = function() {
const rect = this.commandWindowRect();
this._commandWindow = new Window_ShopCommand(rect);
this._commandWindow.setPurchaseOnly(this._purchaseOnly);
this._commandWindow.y = 0;
this._commandWindow.setHandler("buy", this.commandBuy.bind(this));
this._commandWindow.setHandler("sell", this.commandSell.bind(this));
this._commandWindow.setHandler("cancel", this.popScene.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Shop.prototype.commandWindowRect = function() {
const wx = 0;
const wy = 0;
const ww = this._goldWindow.x;
const wh = this.calcWindowHeight(1, true);
return new Rectangle(wx, wy, ww, wh);
};
それを踏まえて下記のプラグインを書きました。
コード: 全て選択
Scene_Shop.prototype.createCommandWindow = function() {
const rect = this.commandWindowRect();
this._commandWindow = new Window_ShopCommand(rect);
this._commandWindow.setPurchaseOnly(this._purchaseOnly);
this._commandWindow.y = parameters['Kategoriitiy'];
this._commandWindow.setHandler("buy", this.commandBuy.bind(this));
this._commandWindow.setHandler("sell", this.commandSell.bind(this));
this._commandWindow.setHandler("cancel", this.popScene.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Shop.prototype.commandWindowRect = function() {
const wx = parameters['Kategoriitix'];
const wy = 0;
const ww = parameters['Kategoriyoko'];
const wh = parameters['Kategoritate'];
return new Rectangle(wx, wy, ww, wh);
};
何が問題なのか私には分かりませんので、どなたかウインドウのY軸の動かし方を御教え頂けませんか。