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
37 전투 ATB전투방식.(사이드뷰X 백발의카임전투방식O) 14 file 이피쿤 2009.06.24 9037
36 ATB v1.0 배틀 시스템 + RPG Tankentai SBS v2.8 16 supergt 2008.10.11 4681
35 그래픽 Arevulopapo's Particle Engine for VX/Ace by PK8 1 Alkaid 2012.05.13 2875
34 AntiLag_1.2h 23 file RPGbooster 2008.10.08 2284
33 전투 Animated Battlers VX 3.7 by DerVVulfman Alkaid 2012.09.07 2102
32 전투 Animated Battlers VX 3.5 by DerVVulfman 2 Alkaid 2011.11.02 3101
31 전투 Animated Battlers VX 3.4 by DerVVulfman 5 file Alkaid 2010.09.10 3117
30 메시지 Advanced Text System 3.0c by Modern Algebra 3 file Alkaid 2010.09.08 2302
29 메시지 Advanced Text System 3.0b by Modern Algebra 3 file Alkaid 2010.09.05 2206
28 저장 Advanced Files 1.3 by Dargor 6 file Alkaid 2010.09.02 2364
27 메뉴 Adding Extra Menu in lafia Script 2 Man... 2008.10.29 1574
26 전투 Actor Battler Graphics 13 아방스 2008.03.07 3065
25 기타 ActivateEvents 8 file EuclidE 2010.09.18 1692
24 전투 ActBattle 전투 스크립트 13 file 사람이라면? 2010.08.16 5962
23 이동 및 탈것 A* 알고리즘을 이용한 길찾기 스크립트 3 file 허걱 2009.04.20 3531
22 ??무슨 스크립트?? 3 Man... 2008.10.27 1323
21 ??? 1 Man... 2008.10.27 1020
20 ??? 2 Man... 2008.10.27 1329
19 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
18 영상 ??(Avi play ver beta 0.8) 4 Man... 2008.10.28 1575
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