#--------------------------------------------------------------------------
# ● require Taroxd基础设置
# 使用方法:地图备注 <parallax fix>、<parallax overlay>
#--------------------------------------------------------------------------
class RPG::Map
note_bool :parallax_fix?
note_bool :parallax_overlay?
end
class Game_Map
#--------------------------------------------------------------------------
# ● 计算远景图显示的原点 X 坐标
#--------------------------------------------------------------------------
def_chain :parallax_ox do |old, bitmap|
if @map.parallax_fix?
@parallax_x = $game_map.display_x * 32
else
old.(bitmap)
end
end
#--------------------------------------------------------------------------
# ● 计算远景图显示的原点 Y 坐标
#--------------------------------------------------------------------------
def_chain :parallax_oy do |old, bitmap|
if @map.parallax_fix?
@parallax_y = $game_map.display_y * 32
else
old.(bitmap)
end
end
#--------------------------------------------------------------------------
# ● 远景图的 Z 坐标
#--------------------------------------------------------------------------
def parallax_z
@map.parallax_overlay? ? 10 : -100
end
end
class Spriteset_Map
#--------------------------------------------------------------------------
# ● 更新远景图
#--------------------------------------------------------------------------
def_after(:update_parallax) { @parallax.z = $game_map.parallax_z }
end