ページ 11

[解決済]各職業にアイコンを表示するプラグイン

Posted: 2018年2月04日(日) 17:47
by サウンドクリエイター葛葉
トピックのタイトル通りなのですが、【アイコン】職業名のような形にしたいです。
ステータス画面とメニュー画面での表示ができれば良いです。

プラグインを製作して下さるという方はよろしくお願いします。

Re: 各職業にアイコンを表示するプラグイン

Posted: 2018年2月04日(日) 17:54
by しぐれん

コード: 全て選択

Window_Base.prototype.drawActorClass = function(actor, x, y, width) {
    width = width || 168;
    this.resetTextColor();
    this.drawIcon(8,x,y);
    this.drawText(actor.currentClass().name, Window_Base._iconWidth +x, y, width);
};

上記のような改造で行けますがどうでしょう?

Re: 各職業にアイコンを表示するプラグイン

Posted: 2018年2月04日(日) 20:39
by サウンドクリエイター葛葉
しぐれん さんが書きました:

コード: 全て選択

Window_Base.prototype.drawActorClass = function(actor, x, y, width) {
    width = width || 168;
    this.resetTextColor();
    this.drawIcon(8,x,y);
    this.drawText(actor.currentClass().name, Window_Base._iconWidth +x, y, width);
};

上記のような改造で行けますがどうでしょう?


これをこのままjsファイル化してつっこめば良い感じなんでしょうか?

Re: 各職業にアイコンを表示するプラグイン

Posted: 2018年2月04日(日) 20:45
by しぐれん
そうですね。
そのままJSファイルにしてプロジェクトに追加してください。

Re: 各職業にアイコンを表示するプラグイン

Posted: 2018年2月04日(日) 20:50
by サウンドクリエイター葛葉
しぐれん さんが書きました:そうですね。
そのままJSファイルにしてプロジェクトに追加してください。


導入できました。ありがとうございます。
ちなみにこれはアイコンは職業毎でバラバラにする事は可能なのでしょうか?

Re: 各職業にアイコンを表示するプラグイン

Posted: 2018年2月04日(日) 21:22
by しぐれん

コード: 全て選択

Window_Base.prototype.drawActorClass = function(actor, x, y, width) {
    width = width || 168;
    this.resetTextColor();
    var iconId = Number( actor.currentClass().meta.icon);
    //ここの8がアイコンのIDです
    this.drawIcon(iconId,x,y);
    this.drawText(actor.currentClass().name, Window_Base._iconWidth +x, y, width);
};


こんな感じにすれば職業ごとにアイコンを変えられます。
あとは職業側に<icon:8>などと書いていけばOKです。

Re: 各職業にアイコンを表示するプラグイン

Posted: 2018年2月04日(日) 21:48
by サウンドクリエイター葛葉
しぐれん さんが書きました:

コード: 全て選択

Window_Base.prototype.drawActorClass = function(actor, x, y, width) {
    width = width || 168;
    this.resetTextColor();
    var iconId = Number( actor.currentClass().meta.icon);
    //ここの8がアイコンのIDです
    this.drawIcon(iconId,x,y);
    this.drawText(actor.currentClass().name, Window_Base._iconWidth +x, y, width);
};


こんな感じにすれば職業ごとにアイコンを変えられます。
あとは職業側に<icon:8>などと書いていけばOKです。


お手数をおかけして申し訳有りません、そしてありがとうございます。