Last active
May 30, 2021 03:50
-
-
Save cacao-soft/1b5482ad6b673efe13f2ea1a8b570e1b to your computer and use it in GitHub Desktop.
RGSS3 戦闘背景にマップ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 戦闘背景となるマップ画像を加工せずに表示します。 | |
# 戦闘背景の床の設定が なし 場合、直前のマップ画像を背景とします。 | |
class << SceneManager | |
#-------------------------------------------------------------------------- | |
# ● 背景として使うためのスナップショット作成 | |
#-------------------------------------------------------------------------- | |
def snapshot_for_background | |
@background_bitmap.dispose if @background_bitmap | |
@background_bitmap = Graphics.snap_to_bitmap | |
@background_bitmap.blur unless scene_is?(Scene_Battle) | |
end | |
end | |
class Spriteset_Battle | |
#-------------------------------------------------------------------------- | |
# ● マップ画面を加工した戦闘背景用ビットマップの作成 | |
#-------------------------------------------------------------------------- | |
def create_blurry_background_bitmap | |
source = SceneManager.background_bitmap | |
bitmap = Bitmap.new(640, 480) | |
bitmap.stretch_blt(bitmap.rect, source, source.rect) | |
bitmap | |
end | |
#-------------------------------------------------------------------------- | |
# ● 戦闘背景(床)ファイル名の取得 | |
#-------------------------------------------------------------------------- | |
def battleback1_name | |
if $BTEST | |
$data_system.battleback1_name | |
elsif $game_map.battleback1_name | |
$game_map.battleback1_name.tap {|fn| break if fn.empty? } | |
elsif $game_map.overworld? | |
overworld_battleback1_name | |
end | |
end | |
end |
タイルセットのモードがエリアタイプの場合、特に設定を変更することなくマップ画像が使用されると思います。
フィールドタイプの場合は、マップの設定やイベントコマンドで戦闘背景の変更を行ない床をなしに設定する必要があります。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景をぼかす
SceneManager.snapshot_for_background の定義は不要
背景を画面サイズに合わせる
背景を等倍にするには、ここのサイズを変更する。
ダメージを受けたときなど、画面シェイク時に画面端に黒いとこ出ます。
背景を暗くする
stretch_blt の最後に引数を追加する