-
-
Save cacao-soft/37cd9af9044c4fa18ebd2e812c15192d to your computer and use it in GitHub Desktop.
RGSS2 メッセージウィンドウより上にピクチャを表示する
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
# 12 番のピクチャをメッセージウィンドウより上に表示する | |
# $game_map.screen.pictures[12].above_message_window = true | |
class Game_Picture | |
#-------------------------------------------------------------------------- | |
# ● 公開インスタンス変数 | |
#-------------------------------------------------------------------------- | |
attr_accessor :above_message_window # Window_Messageより上に表示フラグ | |
end | |
class Spriteset_Map | |
#-------------------------------------------------------------------------- | |
# ● ピクチャ番号からスプライトを取得 | |
#-------------------------------------------------------------------------- | |
def pictures(number) | |
@picture_sprites[number - 1] | |
end | |
end | |
class Scene_Map < Scene_Base | |
#-------------------------------------------------------------------------- | |
# ● 開始処理 | |
#-------------------------------------------------------------------------- | |
alias _cao_picture_z_start start | |
def start | |
_cao_picture_z_start | |
update_pictures | |
end | |
#-------------------------------------------------------------------------- | |
# ● フレーム更新 | |
#-------------------------------------------------------------------------- | |
alias _cao_picture_z_update update | |
def update | |
_cao_picture_z_update | |
update_pictures | |
end | |
#-------------------------------------------------------------------------- | |
# ● ピクチャの更新 (Sprite_Picture#update 後に実行) | |
#-------------------------------------------------------------------------- | |
def update_pictures | |
for pic in $game_map.screen.pictures | |
sp = @spriteset.pictures(pic.number) | |
if pic.above_message_window | |
sp.z = @message_window.z + pic.number | |
sp.viewport = nil | |
else | |
sp.viewport = @viewport2 | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
イベント例: