Por:Valentine
Nome em cima do Personagem
Por valentine
Descrição:
Mostra o nome do personagem em cima do mesmo
Screen:
Por valentine
Descrição:
Mostra o nome do personagem em cima do mesmo
Screen:
- Spoiler:
- Código:
#==============================================================================
# ** Nome em cima do personagem
#------------------------------------------------------------------------------
# By Valentine
#==============================================================================
module Config
# Tamanho da letra
TAMANHO_DA_FONTE = 16
# Nome da fonte
NOME_DA_FONTE = "Tahoma"
# Cor do Nome
#------------------------
# Branco = 255,255,255
# Preto = 0,0,0
# Vermelho = 255,0,0
# Azul = 0,0,255
# Verde = 0,128,0
# Amarelo = 255,255,0
#------------------------
COR_DA_FONTE = Color.new(255,255,255)
# Ativar Negrito
ATIVAR_NEGRITO = false
# Ativar Itálico
ATIVAR_ITALICO = false
end
class Character_Name < RPG::Sprite
def initialize
super()
self.bitmap = Bitmap.new(160, 24)
refresh
end
def refresh
self.bitmap.clear
self.x = $game_player.screen_x - 80
self.y = $game_player.screen_y - 65
self.bitmap.font.size = Config::TAMANHO_DA_FONTE
self.bitmap.font.name = Config::NOME_DA_FONTE
self.bitmap.font.bold = Config::ATIVAR_NEGRITO
self.bitmap.font.italic = Config::ATIVAR_ITALICO
self.bitmap.font.color = Config::COR_DA_FONTE
self.bitmap.draw_text(self.bitmap.rect, $game_party.actors[0].name, 1)
end
end
class Sprite_Character < RPG::Sprite
alias init initialize
alias upd update
def initialize(view, char)
init(view, char)
if @character.is_a?(Game_Player)
@char_name = Character_Name.new
end
end
def update
if @character.is_a?(Game_Player) and @char_name != nil
@char_name.refresh
end
upd
end
end
Créditos:
Valentine (Por criar)
Jiraya (Por disponibilizar)
Valentine (Por criar)
Jiraya (Por disponibilizar)
Última edição por jiraya em Ter Ago 07, 2012 6:34 pm, editado 3 vez(es)