名前入力の上の枠を小さくしたい

しんしん
記事: 6
登録日時: 2017年9月30日(土) 13:46

名前入力の上の枠を小さくしたい

投稿記事by しんしん » 2017年9月30日(土) 16:37

画面サイズを小さくしたので
文字入力の下の部分が入りません
上の部分(名前が出ているところ)を小さく(縦の幅を1行にしたいです)する方法をおしえてください
rpg_windows.jsのどこかというのはわかるのですが
すみませんお願いします。

アバター
ビービー
記事: 308
登録日時: 2016年1月12日(火) 18:40

Re: 名前入力の上の枠を小さくしたい

投稿記事by ビービー » 2017年9月30日(土) 19:30

制作お疲れ様です。

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);に変更。

これでそれっぽくなると思います。

追記:行数はコアスクリプトのバージョンによって多少ずれがあります。
------------------------------------------------------
Twitterやってます。
https://twitter.com/BB_ENTER
ブログもやってます。
http://bb-entertainment-blog.blogspot.jp/
しんしん
記事: 6
登録日時: 2017年9月30日(土) 13:46

Re: 名前入力の上の枠を小さくしたい

投稿記事by しんしん » 2017年9月30日(土) 20:29

大変参考になりました。
本当にありがとうございます。
思い通りに入力可能になりました。
ありがとう

“MV:質問” へ戻る