#============================================================================== # ■ 場所移動のエフェクトにモザイクを追加するスクリプト # Ver 0.01 2012/04/22 # http://fweb.midi.co.jp/~mikagami/atelier/ #------------------------------------------------------------------------------ # # 「場所移動」コマンドの際、モザイクのエフェクトをかけます。 # # 使用方法 # 「場所移動」コマンドの前にスクリプトで次の一文を入れて下さい。 # $game_temp.me_mosaic # # ※注意! # ・「場所移動」コマンドのフェードの指定は無視されます。 # ・他のスクリプトと競合が起こるかもしれません。 # ・ひととおりの動作確認はしていますが、不具合ゼロを保障するものではありません。 # ・このスクリプトの著作権は著者にあります。 #  ですがスクリプトの利用や改造・再配布に著者の許可は必要ありません。 #  著者には未完成な部分の補完や改造依頼に対する対応義務はありません。 #  他者に改造依頼するより、あなた自身が改造すれば、みんなが幸せになります。 # #============================================================================== class Game_Temp #-------------------------------------------------------------------------- # ● 移動エフェクト #-------------------------------------------------------------------------- def me_clear; @fade_type2 = 0; end # クリア def me_mosaic; @fade_type2 = 1; end # モザイクの予約 def me_mosaic?; @fade_type2 == 1; end # モザイク? def me_active? # 有効かどうか @fade_type2 = 0 if @fade_type2 == nil @fade_type2 >= 1 end end class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # ◎ 場所移動前の処理(上書き) #-------------------------------------------------------------------------- def pre_transfer @map_name_window.close if $game_temp.me_active? mosaicout if $game_temp.me_mosaic? else case $game_temp.fade_type when 0 fadeout(fadeout_speed) when 1 white_fadeout(fadeout_speed) end end end #-------------------------------------------------------------------------- # ◎ 場所移動後の処理(上書き) #-------------------------------------------------------------------------- def post_transfer if $game_temp.me_active? update_for_fade mosaicin if $game_temp.me_mosaic? $game_temp.me_clear else case $game_temp.fade_type when 0 Graphics.wait(fadein_speed / 2) fadein(fadein_speed) when 1 Graphics.wait(fadein_speed / 2) white_fadein(fadein_speed) end end @map_name_window.open end #-------------------------------------------------------------------------- # ● 画面のモザイクイン # duration : 時間。モザイクは 16 パターンで構成されており、 # これは 1 パターン当たりの時間。つまり実時間は ×16 フレーム。 #-------------------------------------------------------------------------- def mosaicin(duration = 2) Graphics.brightness = 255 bmps = create_mosaic_bmp_arr spt = Sprite.new spt.z = 255 spt.bitmap = Bitmap.new(Graphics.width, Graphics.height) for i in 0...16 spt.bitmap.stretch_blt(spt.bitmap.rect, bmps[15 - i], bmps[15 - i].rect) spt.color.set(0, 0, 0, (16 - i) ** 2) for j in 0...duration do update_basic end end for i in 0...16 do bmps[i].dispose end spt.dispose end #-------------------------------------------------------------------------- # ● 画面のモザイクアウト # duration : 時間。モザイクは 16 パターンで構成されており、 # これは 1 パターン当たりの時間。つまり実時間は ×16 フレーム。 #-------------------------------------------------------------------------- def mosaicout(duration = 2) bmps = create_mosaic_bmp_arr spt = Sprite.new spt.z = 255 spt.bitmap = Bitmap.new(Graphics.width, Graphics.height) for i in 0...16 spt.bitmap.stretch_blt(spt.bitmap.rect, bmps[i], bmps[i].rect) spt.color.set(0, 0, 0, i ** 2) for j in 0...duration do update_basic end end Graphics.brightness = 0 for i in 0...16 do bmps[i].dispose end spt.dispose end #-------------------------------------------------------------------------- # ● モザイクパターンの作成 #-------------------------------------------------------------------------- def create_mosaic_bmp_arr bmp = Graphics.snap_to_bitmap bmps = [] for i in 0...16 bmps[i] = Bitmap.new(Graphics.width / (i * 2 + 2), Graphics.height / (i * 2 + 2)) bmps[i].stretch_blt(bmps[i].rect, bmp, bmp.rect) end bmp.dispose return bmps end end