class Spriteset_Battle BACK_WIDTH = 960 #-------------------------------------------------------------------------- # ● [别名修改]获取战场背景(地面)的位图 #-------------------------------------------------------------------------- alias battleback1_bitmap_horizontal_loop battleback1_bitmap def battleback1_bitmap src_bmp = battleback1_bitmap_horizontal_loop return src_bmp if src_bmp.width >= BACK_WIDTH src_rect = src_bmp.rect bitmap = Bitmap.new(BACK_WIDTH, src_rect.height) x = y = 0 while x < BACK_WIDTH src_rect.width = [BACK_WIDTH - x, src_rect.width].min bitmap.blt(x, y, src_bmp, src_rect) x += src_rect.width end bitmap end #-------------------------------------------------------------------------- # ● [别名修改]获取战场背景(墙壁)的位图 #-------------------------------------------------------------------------- alias battleback2_bitmap_horizontal_loop battleback2_bitmap def battleback2_bitmap src_bmp = battleback2_bitmap_horizontal_loop return src_bmp if src_bmp.width >= BACK_WIDTH src_rect = src_bmp.rect bitmap = Bitmap.new(BACK_WIDTH, src_rect.height) x = y = 0 while x < BACK_WIDTH src_rect.width = [BACK_WIDTH - x, src_rect.width].min bitmap.blt(x, y, src_bmp, src_rect) x += src_rect.width end bitmap end end
class Spriteset_Battle
BACK_WIDTH = 960
#--------------------------------------------------------------------------
# ● [别名修改]获取战场背景(地面)的位图
#--------------------------------------------------------------------------
alias battleback1_bitmap_horizontal_loop battleback1_bitmap
def battleback1_bitmap
src_bmp = battleback1_bitmap_horizontal_loop
return src_bmp if src_bmp.width >= BACK_WIDTH
src_rect = src_bmp.rect
bitmap = Bitmap.new(BACK_WIDTH, src_rect.height)
x = y = 0
while x < BACK_WIDTH
src_rect.width = [BACK_WIDTH - x, src_rect.width].min
bitmap.blt(x, y, src_bmp, src_rect)
x += src_rect.width
end
bitmap
end
#--------------------------------------------------------------------------
# ● [别名修改]获取战场背景(墙壁)的位图
#--------------------------------------------------------------------------
alias battleback2_bitmap_horizontal_loop battleback2_bitmap
def battleback2_bitmap
src_bmp = battleback2_bitmap_horizontal_loop
return src_bmp if src_bmp.width >= BACK_WIDTH
src_rect = src_bmp.rect
bitmap = Bitmap.new(BACK_WIDTH, src_rect.height)
x = y = 0
while x < BACK_WIDTH
src_rect.width = [BACK_WIDTH - x, src_rect.width].min
bitmap.blt(x, y, src_bmp, src_rect)
x += src_rect.width
end
bitmap
end
end
调大BACK_WIDTH的值,至少大于屏幕的宽度
脚本使用前(震动会出黑边)
脚本使用后
|