RGSS Tips @Wiki
メッセージウィンドウの位置とサイズを変える( when で追加可能)
最終更新:
匿名ユーザー
-
view
#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# ● ウィンドウの位置と不透明度の設定
#--------------------------------------------------------------------------
alias ここに半角小文字の英字で適当な文字列を入れる_reset_window reset_window
def reset_window
上のと同じ文字列を入れる_reset_window # 名前を変えた reset_window を呼び出す
unless $game_temp.in_battle
case $game_system.message_position
when 3
self.x = 0 # X座標
self.y = 320 # Y座標
self.width = 640 # 横幅
self.height = 160 # 高さ
self.back_opacity = 160 # 背景の透明度
end
contents = Bitmap.new(self.width - 32, self.height - 32)
src_rect = Rect.new(0, 0, self.contents.width, self.contents.height)
contents.blt(0, 0, self.contents, src_rect)
self.contents.dispose
self.contents = contents
end
end
end
# ウィンドウを文章の高さに合わせる場合は高さを下のものに変える
# self.height = $game_temp.message_text.scan(/\n/).size * 32 + 32 # 高さ
# イベントコマンドのスクリプト $game_system.message_position = 3 # 「文章の表示」で位置とサイズが変わっている # 「選択肢の表示」では高さに注意が必要です