1 [Script]Nome do Mapa na Tela com HUD 3/1/2012, 12:05
Komuro Takashi
Membro V
E ai pessoal to trazendo um script que mostra o nome do mapa com uma HUD na tela.
Imagem necessária:
Coloque esse script acima do Main.
OBS: Compatível com ou Sem NP.
Script: by Hunter X
Imagem necessária:
- Spoiler:
Coloque esse script acima do Main.
OBS: Compatível com ou Sem NP.
Script: by Hunter X
- Spoiler:
#==================================================#============================
# Map_Loction
#------------------------------------------------------------------------------
# simple map loction ,iam typr note if you want to changr
# by Hunter x
# v. 1.0
# [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
#==============================================================================
module LSRS
module ScriptConfig_001
# time for the hud hidden
Timer = 150
# pictur loction must be on ( Windowskin )
BackGroundImage = "Chip_Location"
# Position(3=down 9=up)
Position = 9
# Opacity of the Hud
Opacity = 155
# Position of the Font (0:Left 1:Midlle 2:right)
LabelPosition = 1
# Font Type and Color
LabelFont = Font.new(["MS UI Gothic", "Tahoma", "Tahoma"])
LabelFont.color = Color.new(0, 0, 0)
#LabelFont.size = 22 #Size of the font
#LabelFont.bold = false # (true : bold, false :Normal)
#LabelFont.italic = false # (true : italic, false :Normal)
end
end
# Dont touch
class LSRS::Sprite_Location < Sprite
include LSRS::ScriptConfig_001
@@cache = {}
def initialize(text)
super()
RPG::Cache.windowskin(BackGroundImage).font = LabelFont
self.z = 9996
self.opacity = 0
@count = 0
@text = text
refresh
set_align
end
def update
if @text != $game_map.map_name
@text = $game_map.map_name
refresh
end
if $game_system.map_interpreter.running?
self.opacity -= 24
@count = 0
elsif @count.zero?
self.opacity -= 12
elsif self.opacity < Opacity
self.opacity = [self.opacity += 12, Opacity].min
else
@count -= 1
end
end
def refresh
if @text.empty?
self.visible = false
return
end
if @@cache[@text]
self.bitmap = @@cache[@text]
else
self.bitmap = RPG::Cache.windowskin(BackGroundImage).dup
self.bitmap.draw_text(self.bitmap.rect, @text, LabelPosition)
@@cache[@text] = self.bitmap
end
self.visible = true
@count = Timer
end
def set_align
self.x = case Position % 3
when 1 then 0
when 2 then 320 - self.width / 2
else 640 - self.width
end
self.y = case Position
when 1 .. 3 then 480 - self.height
when 4 .. 6 then 240 - self.height / 2
else 0
end
end
def height
self.bitmap ? self.bitmap.rect.height : 0
end
def width
self.bitmap ? self.bitmap.rect.width : 0
end
end
class Game_Map
@@mapinfo = load_data("Data/MapInfos.rxdata")
def map_name(id = @map_id)
@@mapinfo[id].name.sub(/@.*/, "")
end
end
class Scene_Map
alias :main_lsrs1 :main
alias :update_lsrs1 :update
def main
@location_sprite = LSRS::Sprite_Location.new($game_map.map_name)
main_lsrs1
@location_sprite.dispose
end
def update
update_lsrs1
@location_sprite.update
end
end