Project1
标题:
改变战斗背景脚本
[打印本页]
作者:
zero2
时间:
2008-2-16 22:06
标题:
改变战斗背景脚本
#==============================================================================
# ■ VX-RGSS2 改变战斗背景 [版本.1.0.0] by Claimh
#------------------------------------------------------------------------------
# 英语翻译 By: Elemental Crisis [http://www.rpgcrisis.net]
# 中文翻译 By: zero2 [http://rpg.blue/web]
#------------------------------------------------------------------------------
# 改变战斗的背景图.
#==============================================================================
module BattleBack
# 选择战斗背景
# 0:当前地图的战斗背景,为战斗背景(默认VX的样式)
# 1:目前使用的地图作为战斗背景
# 2:使用自己的图片,为战斗背景
BB_TYPE = 0 # 在这里输入上面提到的编号
# 显示战斗地面
BT_FLOOR = false
# 使用的图片(如果你选择的编号为2)
M_B_BACK = {
# 地图编号 => "(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
复制代码
作者:
越前リョーマ
时间:
2008-2-16 23:55
复原XP……{/hx}
作者:
纯 小白
时间:
2010-8-14 12:19
提示:
作者被禁止或删除 内容自动屏蔽
作者:
q375430574
时间:
2010-8-14 14:15
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1