메뉴

메뉴 배경화면 바꾸는 스크립트

by 독도2005 posted Mar 23, 2008
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
#==============================================================================
# ¦ [RMVX] Custom Menu Background Effects & Opacity 
#------------------------------------------------------------------------------
# Version 1.0
# by Woratana [woratana@hotmail.com]
# Release Date: 31/01/2008
#
# Exclusive for RPG RPG Revolution
#==============================================================================

module WorBG
#----------------------------------------
# SETUP MENU BACKGROUND & OPACITY HERE!
#---------------------------------------
  BG_MODE = 0 # Mode of BG
  BG_BLUR = true # Turn on (true)/ off (false) to make background blur
  WINDOW_OPACITY = 100 # Opacity for Menu Screens
  THICK_WINDOW_OPACITY = 200 # Opacity for Windows in Title/Battle/End Screens
  BG_MOVE_X = 0 # Move Background in X-coordinate
  BG_MOVE_Y = 0 # Move Background in Y-coordinate
  BG_PICTURE = "filename" # Picture file name when you use custom BG (mode 2)
end

class Scene_Base

  def create_menu_background
    @menuback_sprite = Plane.new
    case WorBG::BG_MODE
    when 0 # Default BG
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.color.set(16, 16, 16, 128)
    
    when 1 # Brighter Default BG
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    
    when 2 # Custom BG
    @menuback_sprite.bitmap = Cache.picture(WorBG::BG_PICTURE)
    
    else
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.color.set(16, 16, 16, 128)
    end
    @menuback_sprite.bitmap.blur if WorBG::BG_BLUR == true
    update_menu_background
  end
  
  alias wor_scebase_upd update
  def update
    @menuback_sprite.ox += WorBG::BG_MOVE_X if @menuback_sprite != nil and WorBG::BG_MOVE_X != 0
    @menuback_sprite.oy += WorBG::BG_MOVE_Y if @menuback_sprite != nil and WorBG::BG_MOVE_Y != 0
  end

  def snapshot_for_background
    $game_temp.background_bitmap.dispose
    $game_temp.background_bitmap = Graphics.snap_to_bitmap
  end
end # Class End

class Window_Base
  
  alias wor_winbase_ini initialize
    def initialize(x, y, width, height)
    wor_winbase_ini(x, y, width, height)
    if $scene.is_a?(Scene_Title) or $scene.is_a?(Scene_Battle) or $scene.is_a?(Scene_End)
      self.back_opacity = WorBG::THICK_WINDOW_OPACITY
    else
      self.back_opacity = WorBG::WINDOW_OPACITY
    end
  end
  
end

 사용법

BG_MODE
0 - 기본 배경
1 - 더 밝은 기본 배경
2 - 사용자 설정 배경화면 (BG_PICTURE = "파일명 (ex:menu_back.jpg)"으로 설정하시고, 해당 그림은 반드시 'Picture' 폴더에 있어야 합니다.)

BG_BLUR = true (배경을 흐리게 만든다.) 혹은 false (배경을 흐리게 하지 않는다.)

WINDOW_OPACITY = 0 to 255 (윈도우 불투명도)
THICK_WINDOW_OPACITY = 0 to 255 (타이틀, 배틀화면, 엔딩화면의 윈도우 불투명도)

BG_MOVE_X = (number) << 배경의 X축
BG_MOVE_Y = (number) << 배경의 Y축
(음수도 설정 가능합니다.)