Project1
标题:
关于 改变战斗背景 [版本.1.0.0] by Claimh
[打印本页]
作者:
Jousun
时间:
2008-2-21 07:02
标题:
关于 改变战斗背景 [版本.1.0.0] by Claimh
首先对作者表示膜拜
非常实用的脚本
本人是脚本白痴
这里有个问题想请教
# 使用的图片(如果你选择的编号为2)
M_B_BACK = {
# 地图编号 => "(Graphics/System/图片名)"
14 => "bg_树林"
10 => "bg_树林"
这一段里我发现不同的地图不能使用同一张背景图
比如我的地图编号10跟14都是森林
想用同一张森林的背景图 但是照上面这样添就会报错
莫非还得把同一张图复制一份?
有没有什么方法可以修改一下?
感谢感谢!
源代码如下
#==============================================================================
# ■ 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 = 2 # 在这里输入上面提到的编号
# 显示战斗地面
BT_FLOOR = false
# 使用的图片(如果你选择的编号为2)
M_B_BACK = {
# 地图编号 => "(Graphics/System/图片名)"
14 => "bg_树林"
10 => "bg_树林"
}
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
复制代码
作者:
Jousun
时间:
2008-2-21 07:05
对不起!!!我错了!!发贴后3秒突然悟到了!!
对不起!!天啊。。。。
我不知道说什么好了
作者:
bbsgg
时间:
2008-2-22 00:34
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1