【解決済】tomoaky様の「TMTrunkGauge」について

白白白
記事: 21
登録日時: 2024年2月28日(水) 22:35

【解決済】tomoaky様の「TMTrunkGauge」について

投稿記事by 白白白 » 2024年2月28日(水) 22:39

既出もしくはスレッド違いでしたら申し訳ありません。

tomoaky様「TMTrunkGauge」
https://plugin.fungamemake.com/archives/2381

上記のプラグインを導入したのはいいのですが、元々の仕様としてゲージが真ん中から左右に広がっていくのが気になり、普通に左から右へと増えるようにできないかと無知ながらjsファイルのあちこちを弄ってみたのですがどうしても変更ができません。

どうかプラグインに詳しい御方にどこをどう修正すればよいのかをお教え頂ければと存じます。
最後に編集したユーザー 白白白 on 2024年3月02日(土) 00:39 [ 編集 1 回目 ]

白白白
記事: 21
登録日時: 2024年2月28日(水) 22:35

Re: tomoaky様の「TMTrunkGauge」について

投稿記事by 白白白 » 2024年3月01日(金) 15:43

追記を失礼致します。
状況が分かりにくかったと思い、画像を添付させて頂きました。
画像のように、なぜかバーの中心から左右に広がっていってしまいます。これを普通に左端から右端へとゲージが増えるようにしたいということです。

もし、仕様として変更は難しいもしくは不可能だという場合も教えて頂けると幸いです。
最後に編集したユーザー 白白白 on 2024年3月01日(金) 22:45 [ 編集 1 回目 ]
ディザ
記事: 25
登録日時: 2023年7月14日(金) 04:56

Re: tomoaky様の「TMTrunkGauge」について

投稿記事by ディザ » 2024年3月01日(金) 22:20

プラグイン内の355行目
this.bitmap.fillRect((this.width / 2) - width / 2, 2, width, this.height - 4, color);
これを

this.bitmap.fillRect(2, 2, width, this.height - 4, color);

こうでいけました。
白白白
記事: 21
登録日時: 2024年2月28日(水) 22:35

Re: tomoaky様の「TMTrunkGauge」について

投稿記事by 白白白 » 2024年3月01日(金) 22:45

ご返信を頂きありがとうございます。

教わる身で恐れ多いのですが...

this.bitmap.fillRect((this.width / 2) - width / 2, 2, width, this.height - 4, color);

上記を、

this.bitmap.fillRect(2, 2, width, this.height - 4, color);

に書き換えても変わらず、

this.bitmap.fillRoundRect((this.width / 2) - width / 2, 2, width, this.height - 4, 3, color);

少し上の上記の部分を書き換えるとゲージの動きが左から右になりました。

ただ、書き換えたことによってゲージから丸みがなくなり、角ばった形になってしまったのですが、丸みを持たせたままにはできないでしょうか...?
ディザ
記事: 25
登録日時: 2023年7月14日(金) 04:56

Re: tomoaky様の「TMTrunkGauge」について

投稿記事by ディザ » 2024年3月01日(金) 23:04

TMBitmapExを導入してたのですね
this.bitmap.fillRoundRect((this.width / 2) - width / 2, 2, width, this.height - 4, 3, color);
                                    ↑ここ
この部分(最初は3)が角の丸み部分を決めてる部分ですので、
この数字を適当に大きくしてみてください

もしfillRoundRectの部分をfillRectと書き換えてしまったのでしたら
348~350行目を
this.bitmap.fillRoundRect(0, 0, this.width, this.height, 3, 'rgba(0, 0, 0, 0.6)');
if (this._trunk > 0) {
this.bitmap.fillRoundRect((2, 2, width, this.height - 4, 3, color);
このようにしてください
白白白
記事: 21
登録日時: 2024年2月28日(水) 22:35

Re: tomoaky様の「TMTrunkGauge」について

投稿記事by 白白白 » 2024年3月01日(金) 23:19

申し訳ありません。書き換えがこんがらがりましたので、まっさらな状態からどうすればいいかを改めて教えて頂いてもよろしいでしょうか?(TMBitmapExを導入しています)
ディザ
記事: 25
登録日時: 2023年7月14日(金) 04:56

Re: tomoaky様の「TMTrunkGauge」について

投稿記事by ディザ » 2024年3月01日(金) 23:30

まっさらな状態で下の部分を
if (Imported.TMBitmapEx) {
this.bitmap.fillRoundRect(0, 0, this.width, this.height, 3, 'rgba(0, 0, 0, 0.6)');
if (this._trunk > 0) {
this.bitmap.fillRoundRect((this.width / 2) - width / 2, 2, width, this.height - 4, 3, color);
}
} else {
this.bitmap.fillRect(0, 0, this.width, this.height, 'rgba(0, 0, 0, 0.6)');
if (this._trunk > 0) {
this.bitmap.fillRect((this.width / 2) - width / 2, 2, width, this.height - 4, color);
こうです
if (Imported.TMBitmapEx) {
this.bitmap.fillRoundRect(0, 0, this.width, this.height, 3, 'rgba(0, 0, 0, 0.6)');
if (this._trunk > 0) {
this.bitmap.fillRoundRect(2, 2, width, this.height - 4, 3, color);
}
} else {
this.bitmap.fillRect(0, 0, this.width, this.height, 'rgba(0, 0, 0, 0.6)');
if (this._trunk > 0) {
this.bitmap.fillRect(2, 2, width, this.height - 4, color);
白白白
記事: 21
登録日時: 2024年2月28日(水) 22:35

Re: tomoaky様の「TMTrunkGauge」について

投稿記事by 白白白 » 2024年3月02日(土) 00:32

ご教示の通りに書き換えたところ、無事に丸みを帯びたまま左から右にゲージが増加するようになりました。

こちらの伝達不足でお手数をお掛けしたにも関わらず、修正にお付き合い頂き、ありがとうございました。

“MV:質問” へ戻る