以下引用snstar2006于2008-3-3 4:24:08的发言:
to 雪风:
case $game_variables[6] #变量6 战斗背景
when 1
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_001")
when 2
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_002")
......
end
这段也太麻烦了点吧?
每次加一个战斗背景就要在加一条分歧
为什麽不用
name = "Graphics/Battlebacks/Battlebacks_" + $game_variables[6].to_s
就好了?
以下引用wy29于2008-3-3 2:21:06的发言:
每次想换背景,就在Scene_Battle里跑:
@spriteset.change_battleback("背景文件的地址")
如果想在任何地方换背景,就得把@spriteset改成global variable.
用 $spriteset
以下引用雪风于2008-3-3 0:06:41的发言:
#--------------------------------------------------------------------------
# ● 生成战斗背景位图
#--------------------------------------------------------------------------
def create_battleback
case $game_variables[5] #变量5 战斗远景
when 1
bitmap = Bitmap.new("Graphics/Parallaxes/StarlitSky")
when 2
bitmap = Bitmap.new("Graphics/Parallaxes/CloudySky")
else
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
end
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = bitmap
@battleback_sprite.tone = Tone.new(0,0,0,255)
@battleback_sprite.x = 0
@battleback_sprite.y = 0
end
#--------------------------------------------------------------------------
# ● 生成战斗场所活动块
#--------------------------------------------------------------------------
def create_battlefloor
@battlefloor_sprite = Sprite.new(@viewport1)
case $game_variables[6] #变量6 战斗背景
when 1
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_001")
when 2
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_002")
when 3
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_003")
when 4
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_004")
when 5
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_005")
when 6
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_006")
when 7
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_007")
when 8
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_008")
when 9
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_009")
when 10
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_010")
else
bitmap = Bitmap.new("Graphics/Battlebacks/Battlebacks_001")
end
@battlefloor_sprite.bitmap = bitmap
@battlefloor_sprite.x = 0
@battlefloor_sprite.y = 0
@battlefloor_sprite.z = 1
@battlefloor_sprite.opacity = 255
end
[本贴由作者于 2008-3-3 0:17:02 最后编辑]
以下引用艾路塞尔于2008-3-3 22:57:52的发言:
这段加在哪?MAIN前?不是吧?
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |