ページ 1 / 1
名前入力の上の枠を小さくしたい
Posted: 2017年9月30日(土) 16:37
by しんしん
画面サイズを小さくしたので
文字入力の下の部分が入りません
上の部分(名前が出ているところ)を小さく(縦の幅を1行にしたいです)する方法をおしえてください
rpg_windows.jsのどこかというのはわかるのですが
すみませんお願いします。
Re: 名前入力の上の枠を小さくしたい
Posted: 2017年9月30日(土) 19:30
by ビービー
制作お疲れ様です。
3428行目
コード: 全て選択
Window_NameEdit.prototype.initialize = function(actor, maxLength) {
var width = this.windowWidth();
var height = this.windowHeight();
var x = (Graphics.boxWidth - width) / 2;
var y = (Graphics.boxHeight - (height + this.fittingHeight(9) + 8)) / 2;
Window_Base.prototype.initialize.call(this, x, y, width, height);
this._actor = actor;
this._name = actor.name().slice(0, this._maxLength);
this._index = this._name.length;
this._maxLength = maxLength;
this._defaultName = this._name;
this.deactivate();
this.refresh();
ImageManager.loadFace(actor.faceName());
};
var y = (Graphics.boxHeight - (height + this.fittingHeight(9) + 8)) / 2;を
var y = (Graphics.boxHeight - (height + this.fittingHeight(12) + 8)) / 2;に変更。
3448行目
コード: 全て選択
Window_NameEdit.prototype.windowHeight = function() {
return this.fittingHeight(4);
};
の4を1に変更。
3500行目
コード: 全て選択
Window_NameEdit.prototype.itemRect = function(index) {
return {
x: this.left() + index * this.charWidth(),
y: 54,
width: this.charWidth(),
height: this.lineHeight()
};
};
54を0に変更。
3536行目
コード: 全て選択
Window_NameEdit.prototype.refresh = function() {
this.contents.clear();
this.drawActorFace(this._actor, 0, 0);
for (var i = 0; i < this._maxLength; i++) {
this.drawUnderline(i);
}
for (var j = 0; j < this._name.length; j++) {
this.drawChar(j);
}
var rect = this.itemRect(this._index);
this.setCursorRect(rect.x, rect.y, rect.width, rect.height);
};
this.drawActorFace(this._actor, 0, 0);をthis.drawActorFace(this._actor, 0, -40);に変更。
これでそれっぽくなると思います。
追記:行数はコアスクリプトのバージョンによって多少ずれがあります。
Re: 名前入力の上の枠を小さくしたい
Posted: 2017年9月30日(土) 20:29
by しんしん
大変参考になりました。
本当にありがとうございます。
思い通りに入力可能になりました。
ありがとう