#==============================================================================
# ■ VX-RGSS2 改变战斗背景 [版本.1.0.0] by Claimh
# 改变战斗的背景图.
#==============================================================================
module BattleBack
# 选择战斗背景
# 0:当前地图的战斗背景,为战斗背景(默认VX的样式)
# 1:目前使用的地图作为战斗背景
# 2:使用自己的图片,为战斗背景
BB_TYPE = 2 # 在这里输入上面提到的编号
# 显示战斗地面
BT_FLOOR = false
# 使用的图片(如果你选择的编号为2)
M_B_BACK = {
# 地图编号 => "(Graphics/System/图片名)"
1 => "戰鬥圖-英文符號"
}
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
#--------------------------------------------------------------------------
def create_battlefloor
create_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ● Delete Battle Floor Sprite
#--------------------------------------------------------------------------
def dispose_battlefloor
dispose_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ● Update Battle Floor Sprite
#--------------------------------------------------------------------------
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