bt = 25 # the border size at the top bl = 5 # the border size at the leftbr = 5 # the border size at the rightbb= 5 # the border size at the bottom复制代码
复制代码
脚本在楼下。
有一些词语我不会翻译,大家可以帮我改吗?
[Ruby] 纯文本查看复制代码
#==============================================================================
# * Spriteset_MiniMap ver 1.5
#------------------------------------------------------------------------------
# Fanha Giang, 2005/11/18
#==============================================================================
class Spriteset_MiniMap
def initialize()
@zoom = 0.25
@size = 32
@dsize = @size * @zoom
@coner = $game_system.minimap_corner
# the viewport for the mini map and the blips
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.z = 6000
# sprite of minimap
@minimap = Sprite_MiniMap.new(@viewport, @dsize)
# bitmap of the minimap
@bitmap = Bitmap.new($game_map.width * @dsize, $game_map.height * @dsize)
# drawer object
@draw_minimap = Draw_MiniBitmap.new(0, @bitmap, 28, 23)
@draw_minimap.map_data = $game_map.data
@draw_minimap.priorities = $game_map.priorities
@draw_minimap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
@draw_minimap.autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
end
# the blips in the map
@mini_sprites = []
for event in $game_map.events.values
@mini_sprites.push(Sprite_Mini_Character.new(@viewport, @zoom, 1 , event))
end
@mini_sprites.push(Sprite_Mini_Character.new(@viewport, @zoom, 0, $game_player))
# viewport of the border and something else addon
@bviewport = Viewport.new(0, 0, 640, 480)
@bviewport.z = 6001
# init the border
@border = Sprite.new(@bviewport)
@border.bitmap = RPG::Cache.picture("border")
# init the map name
@mapname = Sprite.new(@bviewport)
@mapname.x = 30
@mapname.y = 3
@mapname.bitmap = Bitmap.new(200,25)
@mapname.bitmap.font.name = "Tahoma"
@mapname.bitmap.font.size = 21
@mapname.bitmap.font.color = Color.new(255, 0, 0, 255)
@mapname.bitmap.draw_text(@mapname.bitmap.rect, $game_map.name.to_s, 1)
update_viewport
update
end
#--------------------------------------------------------------------------
# - Release
#--------------------------------------------------------------------------
def dispose
# dispose the bitmap
(!@bitmap.nil?) ? @bitmap.dispose : nil
# dispose the mini map sprite
@minimap.dispose
# dispose the blips
for sprite in @mini_sprites
sprite.dispose
end
# dispose the map name
@mapname.bitmap.dispose
@mapname.dispose
#dispose the border
@border.bitmap.dispose
@border.dispose
# dispose the viewport
@viewport.dispose
@bviewport.dispose
end
#--------------------------------------------------------------------------
# - Frame renewal
#--------------------------------------------------------------------------
def update
# draw the map
x1 = (($game_map.display_x - 64) / 128 - 4).to_i
y1 = ($game_map.display_y / 128 - 4).to_i
@draw_minimap.draw(x1,y1)
# update the sprites
@minimap.update(@bitmap)
for sprite in @mini_sprites
sprite.update
end
if @coner != $game_system.minimap_corner
@coner = $game_system.minimap_corner
update_viewport
end
@viewport.visible = $game_system.minimap_visible
@bviewport.visible = $game_system.minimap_visible
end
#--------------------------------------------------------------------------
def update_viewport
width = (640 + @size * 4) * @zoom
height = (480 + @size * 4) * @zoom
bt = 25
bl = 39
br = 39
bb= 5
case $game_system.minimap_corner
when 1
@viewport.rect.set(0 + bl, 0 + bt, width, height)
@bviewport.rect.set(0 , 0 , width + bl + br, height + bt + bb)
when 2
@viewport.rect.set(640 - width - br, 0 + bt, width, height)
@bviewport.rect.set(640 - width - br - bl, 0 , width + bl + br, height + bt + bb)
when 3
@viewport.rect.set(0 + bl, 480 - height - bb, width, height)
@bviewport.rect.set(0 , 480 - height - bb - bt , width + bl + br, height + bt + bb)
when 4
@viewport.rect.set(640 - width - br, 480 - height - bb, width, height)
@bviewport.rect.set(640 - width - br - bl , 480 - height - bb - bt , width + bl + br, height + bt + bb)
end
end
#---------------------------------------------------------------------------------------
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
class Game_System
attr_accessor :minimap_visible # to set the minimap visible or not
attr_accessor :minimap_corner # to set the corner of the minimap 1, 2, 3, 4
alias initialize_minimap initialize
def initialize
@minimap_visible = false
@minimap_corner = 1
initialize_minimap
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
class Game_Map
# add by the script mini map of Fanha Giang
def name
text = $map_infos[@map_id].clone
text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
return text
end
# end of the add by Fanha Giang
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
class Scene_Title
# add by the script mini map of Fanha Giang
def load_map_infos
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
# end add
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------