メッセージウィンドウとピクチャーを同時に消去

初心者ace
記事: 6
登録日時: 2021年7月03日(土) 20:29

メッセージウィンドウとピクチャーを同時に消去

投稿記事by 初心者ace » 2021年7月11日(日) 23:10

初めまして!
掲示板内部で探してみましたが該当するVX Aceのスクリプトが見つからないので恐れ多いですがリクエストさせていただきますでしょうか。
以下のスクリプトをいただきシフトボタンでメッセージウィンドウと同時にピクチャーを除去したいのですが、何か加える事でピクチャーも除去できるスクリプトに出来ませんでしょうか。
シフトボタンを押したらウィンドウと一緒にPicture 1を消す、みたいなイメージです。
使用する際はバトルシーンになります。
宜しければどなたかご助力いただけると嬉しいです。

class Window_Message < Window_Base
alias vis_update update
def update
vis_update
self.visible = !Input.press?(:A) if $game_message.visible
end
end

名無し蛙
記事: 302
登録日時: 2015年11月23日(月) 02:46

Re: メッセージウィンドウとピクチャーを同時に消去

投稿記事by 名無し蛙 » 2021年7月13日(火) 00:05

どうもこんばんは
誘導しておいて放ったらかしも何なので一応答えておきます

ピクチャの消去、というよりも文脈的には非表示の方が適切ですかね
流石にシフトを押したら非表示にし、もう一度押したら再表示されるという仕様ですかこれ?
適当に実用性を考慮しつつ調整するならこんな感じですか

コード: 全て選択

class Game_Temp
  attr_accessor   :visible_other
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  alias :_old_initialize :initialize
  def initialize
    _old_initialize
    @visible_other = true
  end
end

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ○ 開始処理
  #--------------------------------------------------------------------------
  alias :_old_start :start
  def start
    _old_start
    $game_temp.visible_other = true
  end
  #--------------------------------------------------------------------------
  # ○ 終了処理
  #--------------------------------------------------------------------------
  alias :_old_terminate :terminate
  def terminate
    $game_temp.visible_other = true
    _old_terminate
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新(基本)
  #--------------------------------------------------------------------------
  alias :_old_update :update_basic
  def update_basic
    $game_temp.visible_other = !$game_temp.visible_other if Input.trigger?(:A)
    _old_update
  end
end

class Sprite_Picture < Sprite
  #--------------------------------------------------------------------------
  # ○ フレーム更新
  #--------------------------------------------------------------------------
  alias :_old_update :update
  def update
    self.visible = $game_temp.visible_other
    _old_update
  end
end

class Window_Message < Window_Base
  #--------------------------------------------------------------------------
  # ○ フレーム更新
  #--------------------------------------------------------------------------
  alias :_old_update :update
  def update
    self.visible = $game_temp.visible_other
    _old_update
  end
end

今出てる情報で拾う事が出来る仕様はこのくらいですね
初心者ace
記事: 6
登録日時: 2021年7月03日(土) 20:29

Re: メッセージウィンドウとピクチャーを同時に消去

投稿記事by 初心者ace » 2021年7月17日(土) 07:53

名無し蛙 さん

スクリプトまで作っていただきありがとうございます!
ちゃんとPictureも一緒に消えました、ありがとうございます。
可能であれば指定した一部のPicture(e.g. Picture 1)を消したかったのですが、頂いたものを少し弄ってこちらで変更できるか試してみようかと思います。
ありがとうございました!

“VX / Ace:質問” へ戻る