The World of EverGrand


 
PortalPortal  ­InícioInício  ­FAQFAQ  ­BuscarBuscar  ­Parceiros  ­Chatbox  ­Registrar-seRegistrar-se  ­LoginLogin  
Painel do Usuário
Anonymous
Mensagens: 0

Últimos assuntos
» Duro.... ;P
Ontem à(s) 3:12 pm por Nelson William

» Alucard_2's Classroom 1: Comandos básicos de RGSS2
Ter Jul 27, 2010 6:15 pm por Alucard_2

» Links bugados!
Dom Jul 25, 2010 6:54 pm por Alucard_2

» Pictures de Planetas, deuses, pictures de guerras e coisas referentes.
Qui Jul 22, 2010 6:41 pm por Angel Warrior

» Eventos essenciais para a criação de um jogo de pokémon.
Qui Jul 22, 2010 6:35 pm por Angel Warrior

» Banco Monetário
Qui Jul 22, 2010 6:33 pm por Angel Warrior

» Personalizando Mensagens
Qui Jul 22, 2010 6:31 pm por Angel Warrior

» Fabrica De avatares, titles, Game overs, Assinaturas,etc
Qui Jul 22, 2010 12:44 am por Wolf_Moon

» Scene_Credits - Ponha Créditos no seu jogo!
Qua Jul 21, 2010 8:52 pm por Alucard_2

Top dos mais postadores
Douglanilo (959)
 
Raygodness (404)
 
zero (301)
 
mayumi (186)
 
Suigiure (119)
 
RenatoMW (101)
 
Angel Warrior (93)
 
LichKing (72)
 
DouglasEagle (65)
 
Dragus-kai (58)
 
Adicione o CHAT via MSN!

Adicione nos Favoritos!
Contador de Visitas
Banner
Quer ser parceiro? Clique AQUI.

Ever Grand no Mundo
Sites amigos
Quer ver todos os Parceiros? Clique AQUI.


42° Hangar
Dungeon Makers
Mundo Zumbi

Laboratório Vermelho
Novo TópicoResponder ao tópicoCompartilhe|

HUD estilo Castlevania Symphony of the Night

Ver o tópico anterior Ver o tópico seguinte Ir em baixo
AutorMensagem
Alucard_2

Membro Especial
Membro Especial

Masculino Postagens: 6
Data de inscrição: 29/01/2010


Ver perfil do usuário
MensagemAssunto: HUD estilo Castlevania Symphony of the Night Qua Jul 21, 2010 8:42 pm

Introdução


Este script cria uma HUD ao estilo Castlevania Symphony of the Night (PSX).
Para saber mais, olhe as screenshots.
ATENÇÃO! ESTE script É UMA MODIFICAÇÃO DA HUD DO script "REQUIEM SBABS",
PORTANTO, VOCÊ:

* AO UTILIZAR O script, OS CRÉDITOS TAMBÉM DEVEM SER DADOS AO CRIADOR DO
"REQUIEM SBABS".

* ESTÁ PROIBIDO DE UTILIZAR O script PARA POSTAR EM ALGUM OUTRO FÓRUM.


ScreenShots



Screenshot retirada do meu projeto: Castlevania - A Origem do Mal, no qual fiz o script.

script e como usar

1º passo: Cole o script na seção "scripts Adicionais".
2º passo: Nas linhas 21 a 31, você encontrará o seguinte:

Código:
# Fundo da HUD em si
Background = "hpbar"

#  Imagem da barra de MP
MP_Bar = "mpbar"

# Imagem de fundo da barra de MP/número do HP
Base = "hpbar"

# Switch que irá ativar/desativar a HUD
OnOff_Hud_Switch = 20


A explicação está logo aqui:
Background - Imagem de fundo da HUD
MP_Bar - Imagem da barra de MP
Base - Fundo da barra de MP e do HP

Mude o nome das imagens (o nome está entre os "") para o nome da imagem desejada.

Ah, é claro, tem também o OnOff_Hud_Switch, que é a ID da switch que liga/desliga a HUD.

script


Código:
################################################################################
# Castlevania SOTN HUD                                                        #
################################################################################
# script original por: Vlad                                                    #
# Tradução do script original por: Henrik                                      #
# Modificação por :Alucard_2                                                  #
#                                                                              #
# ATENÇÃO! ESTE script É UMA MODIFICAÇÃO DA HUD DO script "REQUIEM SBABS",    #
# PORTANTO, VOCÊ:                                                              #
#                                                                              #
# * AO UTILIZAR O script, OS CRÉDITOS TAMBÉM DEVEM SER DADOS AO CRIADOR DO    #
# "REQUIEM SBABS".                                                            #
#                                                                              #
# * ESTÁ PROIBIDO DE UTILIZAR O script PARA POSTAR EM ALGUM OUTRO FÓRUM.      #
#                                                                              #
################################################################################
#==============================================================================
# Crissaegrim HUD (Modificada)
#==============================================================================

# HUD Background Image
Background = "hpbar"

# MP Bar Image
MP_Bar = "mpbar"

# HP and MP Bars Background Image
Base = "hpbar"

# Switch that show or hide the HUD
OnOff_Hud_Switch = 20

##################################
class Requiem_HUD1 < Window_Base
 
  def initialize
    super(-32,-32,224,140)
    self.opacity = 0
    update
  end
 
  def update
    return if $game_party.members.size <= 0
    @actor = $game_party.members[0]
    self.contents.clear
    draw_mpbar(@actor, 25, 25)
    draw_actor_hp_number(@actor, 0, 40)
    for actor in $game_party.members
      next if actor == @actor
      xx = (actor.index-1)*64
      draw_ally_life(actor,16+xx,64)
      draw_actor_head(actor,16+xx,72)
    end
  end
 
  def draw_ally_life(actor,x,y)
    self.contents.font.size = 16
    self.contents.font.color = text_color(15)
    self.contents.draw_text(x+33,y+1,contents.width,24,"#{actor.hp}")
    self.contents.draw_text(x+33,y+19,contents.width,24,"#{actor.mp}")
    if actor.hp <= (actor.maxhp * 25) / 100
      self.contents.font.color = text_color(2)
    elsif actor.hp <= actor.maxhp / 2
      self.contents.font.color = text_color(6)
    else
      self.contents.font.color = text_color(3)
    end
    self.contents.draw_text(x+32,y,contents.width,24,"#{actor.hp}")
    self.contents.font.color = text_color(1)
    self.contents.draw_text(x+32,y+18,contents.width,24,"#{actor.mp}")
  end
 
  def draw_hpbar(actor, x, y)
    back = Cache.system(Base)
    cw = back.width
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x, y, back, src_rect)
    return if actor.hp <= 0
    meter = Cache.system(HP_Bar)
    cw = meter.width  * actor.hp / actor.maxhp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x, y, meter, src_rect)
  end 
 
  def draw_mpbar(actor, x, y)
    back = Cache.system(Base)   
    cw = back.width
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)   
    self.contents.blt(x, y, back, src_rect)
    return if actor.mp <= 0
    meter = Cache.system(MP_Bar)   
    cw = meter.width  * actor.mp / actor.maxmp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 57, y + 12, meter, src_rect)
  end
 
end
class Scene_Map < Scene_Base
 
  alias crissaegrim_hud_start start
  alias crissaegrim_hud_update update
  alias crissaegrim_hud_terminate terminate
 
  def start
    crissaegrim_hud_start
    @hud_window1 = Requiem_HUD1.new
    @hud_window1.visible = false
    showing_hud
  end
 
  def update
    crissaegrim_hud_update
    @hud_window1.update
    showing_hud
  end
 
  def terminate
    crissaegrim_hud_terminate
    @hud_window1.dispose
  end
 
  def showing_hud
    if OnOff_Hud_Switch <= 0 or $game_switches[OnOff_Hud_Switch] == true
      @hud_window1.visible = true
    else
      @hud_window1.visible = false
    end
  end

end

###############
# Window_Base #
###############

class Window_Base < Window

  #--------------------------------------------------------------------------
  # Exibição do HP
  #    actor : herói
  #    x    : exibe na coordenada X
  #    y    : exibe na coordenada Y
  #    width : largura
  #--------------------------------------------------------------------------
  def draw_actor_hp_number(actor, x, y, width = 120)
    if actor.hp == actor.maxhp
      self.contents.font.color = Color.new(255,255,255,255)
    else
      if actor.hp / actor.maxhp <= 30#self.contents.font.color = hp_color(actor)
        self.contents.font.color = Color.new(235,235,235,255)
      end
    end
    self.contents.font.size = 30
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 40, y, 40, WLH, actor.hp, 2)
    else
      self.contents.draw_text(xr - 90, y, 40, WLH, actor.hp, 2)
    end
  end
end
#==============================================================================
# Window_StatusMap
#------------------------------------------------------------------------------
# Janela que exibe o HP e MP do personagem principal.
#==============================================================================

class Window_StatusMap < Window_Base
  #--------------------------------------------------------------------------
  # Inicialização do objeto
  #    actor : herói
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 544, 416)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # Atualização
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_hp(@actor, 50, 0)
  end
end


Créditos


Vlad - Criação do script original.
Henrik - Tradução do script original.
Alucard_2 - Modificação para HUD de Castlevania.


Imagens Necessárias





_________________________________________
Eu sou eu e nada mais







Voltar ao Topo Ir em baixo
Wolf_Moon

Novato
Novato

Postagens: 9
Data de inscrição: 21/07/2010


Ver perfil do usuário
MensagemAssunto: Re: HUD estilo Castlevania Symphony of the Night Qua Jul 21, 2010 8:48 pm

Òtimo!
Continue assim!
Voltar ao Topo Ir em baixo

HUD estilo Castlevania Symphony of the Night

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo
Página 1 de 1

Permissão deste fórum:Você não pode responder aos tópicos neste fórum
The World of EverGrand :: Programação em Linguagens :: Ruby Game Scripting System :: Scripts :: RPG Maker VX-
Novo TópicoResponder ao tópico