#==============================================================================
# Spriteset_Map
#------------------------------------------------------------------------------
# Classe responsável pela compilação dos sprites utilizados nos mapas.
# Esta classe é utilizada dentro da classe Scene_Map.
#==============================================================================
class Scene_Map
def sair
@spriteset.viewport4.visible = true
end
def entrar
@spriteset.viewport4.visible = false
end
end
class Spriteset_Map
attr_accessor :viewport4
def initialize
create_viewports
create_tilemap
create_parallax
create_characters
create_shadow
create_weather
create_pictures
create_timer
create_roof
update
end
def create_viewports
@viewport1 = Viewport.new(0, 0, 544, 416)
@viewport4 = Viewport.new(0, 0, 544, 416)
@viewport2 = Viewport.new(0, 0, 544, 416)
@viewport3 = Viewport.new(0, 0, 544, 416)
@viewport2.z = 50
@viewport3.z = 100
end
#--------------------------------------------------------------------------
# Criação dos tiles
#--------------------------------------------------------------------------
def create_roof
@roof_data = load_data("Data/MapInfos.rvdata")
for i in
1..@roof_data.size + 1
if @roof_data[i] != nil
if @roof_data[i].name == @roof_data[$game_map.map_id].name + "[T]"
@roof = Tilemap.new(@viewport4)
@roof.bitmaps[0] = Cache.system("TileA1")
@roof.bitmaps[1] = Cache.system("TileA2")
@roof.bitmaps[2] = Cache.system("TileA3")
@roof.bitmaps[3] = Cache.system("TileA4")
@roof.bitmaps[4] = Cache.system("TileA5")
@roof.bitmaps[5] = Cache.system("TileB")
@roof.bitmaps[6] = Cache.system("TileC")
@roof.bitmaps[7] = Cache.system("TileD")
@roof.bitmaps[8] = Cache.system("TileE")
@map_d = load_data(sprintf("Data/Map%03d.rvdata", i))
@roof.map_data = @map_d.data
end
end
end
end
def dispose
dispose_tilemap
dispose_parallax
dispose_characters
dispose_shadow
dispose_weather
dispose_pictures
dispose_timer
dispose_viewports
end
def dispose_tilemap
@tilemap.dispose
if @roof != nil
@roof.dispose
end
end
def dispose_viewports
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
@viewport4.dispose
end
def update
update_tilemap
update_roof
update_parallax
update_characters
update_shadow
update_weather
update_pictures
update_timer
update_viewports
end
def update_roof
if @roof != nil
@roof.ox = $game_map.display_x / 8
@roof.oy = $game_map.display_y / 8
@roof.update
end
end
#--------------------------------------------------------------------------
# Atualização do panorama
#--------------------------------------------------------------------------
def update_viewports
@viewport1.tone = $game_map.screen.tone
@viewport1.ox = $game_map.screen.shake
@viewport2.color = $game_map.screen.flash_color
@viewport3.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
@viewport1.update
@viewport2.update
@viewport3.update
@viewport4.update
end
end