VX 스크립트

#==============================================================================
# ■ VX-RGSS2-7 Change Battle Background [Ver.1.0.0]     by Claimh
#------------------------------------------------------------------------------
# English Translation By: Elemental Crisis [http://www.rpgcrisis.net]
#------------------------------------------------------------------------------
# Changes the battle background.
#==============================================================================


module BattleBack
  #   Select Battle Background Type
  #   0:Current map with wave effect for battle background (Default VX Style).
  #   1:Current map used as battle background. 
  #   2:Uses a picture for battle background. 
  BB_TYPE = 0
  
  # Display Battle Floor
  BT_FLOOR = false

  # Picture (Only required if BB_TYPE = 2)
  M_B_BACK = {
    # Map ID => "Picture File Name(Graphics/System)"
    1 => "001-Grassland01"
  }
end


#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● Creating Battle Back Sprite
  #--------------------------------------------------------------------------
  def create_battleback
    case BattleBack::BB_TYPE
    when 0
      source = $game_temp.background_bitmap
      bitmap = Bitmap.new(640, 480)
      bitmap.stretch_blt(bitmap.rect, source, source.rect)
      bitmap.radial_blur(90, 12)
      @battleback_sprite = Sprite.new(@viewport1)
      @battleback_sprite.bitmap = bitmap
      @battleback_sprite.ox = 320
      @battleback_sprite.oy = 240
      @battleback_sprite.x = 272
      @battleback_sprite.y = 176
      @battleback_sprite.wave_amp = 8
      @battleback_sprite.wave_length = 240
      @battleback_sprite.wave_speed = 120
    when 1
      source = $game_temp.background_bitmap
      bitmap = Bitmap.new(640, 480)
      bitmap.stretch_blt(bitmap.rect, source, source.rect)
      @battleback_sprite = Sprite.new(@viewport1)
      @battleback_sprite.bitmap = bitmap
      @battleback_sprite.ox = 320
      @battleback_sprite.oy = 240
      @battleback_sprite.x = 272
      @battleback_sprite.y = 176
    when 2
      @battleback_sprite = BattleBackSprite.new(@viewport1)
    end
  end
  #--------------------------------------------------------------------------
  # ● Creating Battle Floor Sprite
  #--------------------------------------------------------------------------
  alias create_battlefloor_mbb create_battlefloor
  def create_battlefloor
    create_battlefloor_mbb if BattleBack::BT_FLOOR
  end
  #--------------------------------------------------------------------------
  # ● Delete Battle Floor Sprite
  #--------------------------------------------------------------------------
  alias dispose_battlefloor_mbb dispose_battlefloor
  def dispose_battlefloor
    dispose_battlefloor_mbb if BattleBack::BT_FLOOR
  end
  #--------------------------------------------------------------------------
  # ● Update Battle Floor Sprite
  #--------------------------------------------------------------------------
  alias update_battlefloor_mbb update_battlefloor
  def update_battlefloor
    update_battlefloor_mbb if BattleBack::BT_FLOOR
  end
end


#==============================================================================
# ■ BattleBackSprite
#==============================================================================
class BattleBackSprite < Sprite
  # Background Screen Size
  WIDTH  = 544.00
  HEIGHT = 288.00
  #--------------------------------------------------------------------------
  # ● Object Initialization
  #     viewport : viewport
  #--------------------------------------------------------------------------
  def initialize(viewport = nil)
    super(viewport)
    self.bitmap = Cache.system(BattleBack::M_B_BACK[$game_map.map_id])
    # Zoom is carried out according to picture size.
    @x_zoom = WIDTH / self.bitmap.width
    @y_zoom = HEIGHT / self.bitmap.height
    @zoom = @x_zoom > @y_zoom ? @x_zoom : @y_zoom
    # Zoom is carried out.
    self.zoom_x = @zoom
    self.zoom_y = @zoom
    # Made into central display.
    self.ox = self.bitmap.width / 2
    self.oy = self.bitmap.height / 2
    self.x = (self.bitmap.width / 2)  * @zoom
    self.y = (self.bitmap.height / 2) * @zoom
  end
end

Comment '45'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5408
17 Screen Resolution 3 Man... 2008.10.28 1171
16 LevelMe v1.2 3 Man... 2008.10.27 1154
15 Screen Shortcut Script Man... 2008.10.27 1142
14 메뉴 MOG - Scroll Bar for VX file 습작 2014.07.06 1115
13 Multi-threader snippet by Omegazion Man... 2008.10.28 1107
12 Scene_Credit script Plug & Play 1 Man... 2008.10.27 1085
11 메뉴 KGC - 커스텀 메뉴 커멘드 (번역) 1 듀란테 2015.07.27 1080
10 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
9 메시지 Etude87 Dialogue History Scene file 습작 2014.07.07 1070
8 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 1046
7 버그픽스 Graphical Object Global Reference VX by Mithran Alkaid 2014.03.03 1027
6 ??? 1 Man... 2008.10.27 1020
5 저장 세이브 파일 개수 16개로 늘리기 (기본 세이브 엔진용) 1 file Bunny_Boy 2015.09.07 817
4 메뉴 Etude87_Ace_Style_Formation_Change ver.1.01 습작 2014.10.05 758
3 아이템 현재있는 파티원 선택 레벨업 아이템 만들기 1 file 싸패 2016.06.06 713
2 버그픽스 DerVVulfman's Tileset Reader VX Bug Fix 습작 2014.11.16 701
1 기타 Gamepad Extender VX 습작 2015.01.02 672
Board Pagination Prev 1 ... 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Next
/ 32