Alguem ae tem Sprit de nome encima do npc para jogos offline? se tiverem mim passem
3 participantes
Nome Encima do NPC
Komuro Takashi- Colaborador
- Mensagens : 1047
Créditos : 130
- Mensagem nº2
Re: Nome Encima do NPC
Cara Sprit não, mas eu tenho o Script pra isso
Segue o Script no Spoiler:
Crédito ao Valentine que fez esse script que serve tanto para Games On com Off
Segue o Script no Spoiler:
- Spoiler:
#==============================================================================
# ** 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édito ao Valentine que fez esse script que serve tanto para Games On com Off
_________________
Paga um café? Patreon
- Mensagem nº3
Re: Nome Encima do NPC
Komuro ele quer em cima dos NPC e não do personagem.
Aqui peguei do netplay e adaptei para jogos off.
Para usar bote um comentário em um evento assim: Name nome_do_npc
Aqui peguei do netplay e adaptei para jogos off.
- Código:
#==============================================================================
# ** Event Text Display
#==============================================================================
# Created By: Áص¹
# Modified By: SephirothSpawn
# Modified By: Me™
# Modified By: Valentine
# Version 2.1
# 2006-03-04
#==============================================================================
# * Instructions :
#
# ~ Creating Event With Test Display
# - Put a Comment on the Page With
# [Name____]
# - Place Text to Be Displayed in the Blank
#------------------------------------------------------------------------------
# * Customization :
#
# ~ NPC Event Colors
# - Event_Color = Color
#
# ~ Player Event Color
# - Player_Color = Color
#
# ~ Player Text
# - Player_Text = text_display *
#
# ~ text_display
# - 'Name', 'Class', 'Level', 'Hp', 'Sp'
#==============================================================================
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Dispaly Text Color (Event & Player)
#--------------------------------------------------------------------------
Event_Color = Color.new(255, 255, 255)
Player_Color = Color.new(255, 255, 255)
#--------------------------------------------------------------------------
# * Display Choices
# ~ 'Name', 'Class', 'Level', 'Hp', 'Sp'
#--------------------------------------------------------------------------
Player_Text = 'Name'
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :text_display
end
#==============================================================================
# ** Game_Event
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_characterdisplay_gevent_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Original Refresh Method
seph_characterdisplay_gevent_refresh
# Checks to see if display text
# If the name contains CD, it takes the rest of the name as the text
unless @list.nil?
for i in 0...@list.size
if @list[i].code == 108
@list[i].parameters[0].dup.gsub!(/Name (.*)/) do
@text_display = [$1, Event_Color]
end
end
end
end
@text_display = nil if @erased
end
end
#==============================================================================
# ** Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_characterdisplay_gplayer_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Original Refresh Method
seph_characterdisplay_gplayer_refresh
# Gets First Actor
name = $game_party.actors[0]
# Determines Text
case Player_Text
when 'Name'
txt = $game_party.actors[0].name
when 'Class'
txt = actor.class_name
when 'Level'
txt = "Level: #{actor.level}"
when 'Hp'
txt = "HP: #{actor.hp} / #{actor.maxhp}"
when 'Sp'
txt = "SP: #{actor.sp} / #{actor.maxsp}"
else
txt = ''
end
end
end
#==============================================================================
# ** Sprite_Character
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_characterdisplay_scharacter_update update
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original update Method
seph_characterdisplay_scharacter_update
# Character Display Update Method
update_display_text
end
#--------------------------------------------------------------------------
# * Create Display Sprite
#--------------------------------------------------------------------------
def create_display_sprite(args)
# Creates Display Bitmap
bitmap = Bitmap.new(160, 24)
bitmap.font.size = 15
#bitmap.width = args[0].size+32
# Draws Text Shadow
bitmap.font.draw_shadow = false if bitmap.font.respond_to?(:draw_shadow)
bitmap.font.color = Color.new(0, 0, 0)
bitmap.draw_text(1, 1, 160, 24, args[0], 1)
bitmap.font.color = args[1]
# Draws Text
bitmap.draw_text(0, 0, 160, 24, args[0], 1)
# Creates Display Text Sprite
@_text_display = Sprite.new(self.viewport)
@_text_display.bitmap = bitmap
#@_text_display.opacity = 180
@_text_display.ox = 80
@_text_display.oy = 20
@_text_display.x = self.x
@_text_display.y = self.y - self.oy / 2 - 24
@_text_display.z = 30001
@_text_display.visible = self.visible #true
end
def create_display_guild(args)
# Creates Display Bitmap
bitmap = Bitmap.new(160, 24)
bitmap.font.name = "Comic Sans MS"
bitmap.font.size = 15
actor = $game_party.actors[0]
# Draws Text Shadow
if bitmap.font.respond_to?(:draw_shadow)
bitmap.font.draw_shadow = false
end
bitmap.font.color = Color.new(0, 0, 0)
bitmap.draw_text(6, 1, 160, 24, actor.guild, 1)
#bitmap.fill_rect(actor.guild.size*8+3,5,actor.guild.getw,13, Color.new(40, 40, 40))
# Changes Font Color
#bitmap.font.color = Color.new(0,0,0)
#bitmap.draw_text(-1, 2-1, 160, 20, actor.guild, 1)
#bitmap.draw_text(+1, 2-1, 160, 20, actor.guild, 1)
#bitmap.draw_text(-1, 2+1, 160, 20, actor.guild, 1)
#bitmap.draw_text(+1, 2+1, 160, 20, actor.guild, 1)
bitmap.font.color = args[0]
# Draws Text
#desenha bandeira
=begin
icon = RPG::Cache.icon("")
icon.fill_rect(0, 0, 2, 2, $Bandeira[0])
icon.fill_rect(2, 0, 2, 2, $Bandeira[1])
icon.fill_rect(4, 0, 2, 2, $Bandeira[2])
icon.fill_rect(6, 0, 2, 2, $Bandeira[3])
icon.fill_rect(8, 0, 2, 2, $Bandeira[4])
icon.fill_rect(10, 0, 2, 2, $Bandeira[5])
#vertical 2
icon.fill_rect(0, 2, 2, 2, $Bandeira[6])
icon.fill_rect(2, 2, 2, 2, $Bandeira[7])
icon.fill_rect(4, 2, 2, 2, $Bandeira[8])
icon.fill_rect(6, 2, 2, 2, $Bandeira[9])
icon.fill_rect(8, 2, 2, 2, $Bandeira[10])
icon.fill_rect(10, 2, 2, 2, $Bandeira[11])
#vertical 3
icon.fill_rect(0, 4, 2, 2, $Bandeira[12])
icon.fill_rect(2, 4, 2, 2, $Bandeira[13])
icon.fill_rect(4, 4, 2, 2, $Bandeira[14])
icon.fill_rect(6, 4, 2, 2, $Bandeira[15])
icon.fill_rect(8, 4, 2, 2, $Bandeira[16])
icon.fill_rect(10, 4, 2, 2, $Bandeira[17])
#vertical 4
icon.fill_rect(0, 6, 2, 2, $Bandeira[18])
icon.fill_rect(2, 6, 2, 2, $Bandeira[19])
icon.fill_rect(4, 6, 2, 2, $Bandeira[20])
icon.fill_rect(6, 6, 2, 2, $Bandeira[21])
icon.fill_rect(8, 6, 2, 2, $Bandeira[22])
icon.fill_rect(10, 6, 2, 2, $Bandeira[23])
#vertical 5
icon.fill_rect(0, 8, 2, 2, $Bandeira[24])
icon.fill_rect(2, 8, 2, 2, $Bandeira[25])
icon.fill_rect(4, 8, 2, 2, $Bandeira[26])
icon.fill_rect(6, 8, 2, 2, $Bandeira[27])
icon.fill_rect(8, 8, 2, 2, $Bandeira[28])
icon.fill_rect(10, 8, 2, 2, $Bandeira[29])
bitmap.blt(55-actor.guild.size,8,icon,icon.rect)
=end
bitmap.draw_text(5, 0, 160, 24, actor.guild, 1)
$old_guild = args[0]
# Creates Display Text Sprite
@_g_display = Sprite.new(self.viewport)
@_g_display.bitmap = bitmap
#@_g_display.opacity = 180
@_g_display.ox = 80
@_g_display.oy = 22
@_g_display.x = self.x
@_g_display.y = self.y - self.oy / 2 - 24
@_g_display.z = 30001
@_g_display.visible = self.visible #true
end
#--------------------------------------------------------------------------
# * Dispose Display Sprite
#--------------------------------------------------------------------------
def dispose_display_text
@_text_display.dispose unless @_text_display.nil?
end
#--------------------------------------------------------------------------
# * Update Display Sprite
#--------------------------------------------------------------------------
def update_display_text
unless @character.text_display.nil?
create_display_sprite(@character.text_display) if @_text_display.nil?
@_text_display.x = self.x
@_text_display.y = self.y - self.oy / 2 - 24
else
dispose_display_text unless @_text_display.nil?
end
end
end
Para usar bote um comentário em um evento assim: Name nome_do_npc
donay- Novato
- Mensagens : 5
Créditos : 1
- Mensagem nº4
Re: Nome Encima do NPC
Nossa Cara vlw ae funfo aki :DD
vlw +1
vlw +1