Castlevania Coders
Seja bem-vindo ao forum da Castlevania Coders
Você não está Conectado...
Fassa login ou se Registre

HUD com todos os personagens

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

Script HUD com todos os personagens

Mensagem por lasso em Qui Out 28, 2010 3:20 pm

[size=14pt]HUD com todos os personagens[/size]
por lasso

Introdução
Essa é uma HUD com todos os personagens da equipe, se adicionar personagens ou tirar personagens da equipe, somem/aparecem personagens da HUD.

Instruções

1.0
Para colocá-la em seu projeto, basta colocá-la acima de main.

2.0/3.0
Coloque acima de main e substitua "[1]" da linha 13 por "[ID da switch]", pois na versao 2.0/3.0 a HUD aparece/some se um switch estiver ON/OFF.

Screens
1.0/2.0
Spoiler:
3.0
Spoiler:

Script
1.0
Código:
class HUD < Window_Base
  def initialize
    super (0,0,544,416)
    self.back_opacity = 0
    self.opacity = 0
    refresh
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      y = actor.index * 60 +  40
      draw_actor_graphic(actor, 16, y)
      draw_actor_hp(actor, 32, y - 40)
      draw_actor_mp(actor, 32, y - 20)
    end
  end
end
class Scene_Map < Scene_Base
  alias startHUD start
  alias terminateHUD terminate
  alias updateHUD update
  def start
    startHUD
    @hud = HUD.new
  end
  def hud_vars
    @hp1 = $game_actors[1].hp
    @mp1 = $game_actors[1].mp
    @hp2 = $game_actors[2].hp
    @mp2 = $game_actors[2].mp
    @hp3 = $game_actors[3].hp
    @mp3 = $game_actors[3].mp
    @hp4 = $game_actors[4].hp
    @mp4 = $game_actors[4].mp
  end
  def terminate
    terminateHUD
    @hud.dispose
  end
  def update
    updateHUD
    if @hp1 != $game_actors[1].hp or @mp1 != $game_actors[1].mp or @hp2 != $game_actors[2].hp or @mp2 != $game_actors[2].mp or @hp3 != $game_actors[3].hp or @mp3 != $game_actors[3].mp or @hp4 != $game_actors[4].hp or @mp4 != $game_actors[4].mp
      @hud.refresh
      hud_vars
    end
  end
end

2.0
Código:
##############################################
################    HUD  ####################
##############################################
#uma hud com todos os herois da equipe que pode
#ser ativada/desativada com um switch
#============================================#
#---------------configuraçoes----------------#
#============================================#
class Scene_Map < Scene_Base
  alias config update
  def update
    config
    @hud.visible = $game_switches[1]#coloque aqui o id do switch condicional
    #se quiser que a hud fique sempre visivel, troque "$game_switches[1]" por "true"
  end
end
#============================================#
#----------------Script----------------------#
#============================================#
#nao mexa se nao tiver conhecimento de RGSS2
class HUD < Window_Base
  def initialize
    super (0,0,544,416)
    self.back_opacity = 0
    self.opacity = 0
    refresh
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      y = actor.index * 60 +  40
      draw_actor_graphic(actor, 16, y)
      draw_actor_hp(actor, 32, y - 40)
      draw_actor_mp(actor, 32, y - 20)
    end
  end
end
class Scene_Map < Scene_Base
  alias startHUD start
  alias terminateHUD terminate
  alias updateHUD update
  def start
    startHUD
    @hud = HUD.new
  end
  def hud_vars
    @hp1 = $game_actors[1].hp
    @mp1 = $game_actors[1].mp
    @hp2 = $game_actors[2].hp
    @mp2 = $game_actors[2].mp
    @hp3 = $game_actors[3].hp
    @mp3 = $game_actors[3].mp
    @hp4 = $game_actors[4].hp
    @mp4 = $game_actors[4].mp
  end
  def terminate
    terminateHUD
    @hud.dispose
  end
  def update
    updateHUD
    if @hp1 != $game_actors[1].hp or @mp1 != $game_actors[1].mp or @hp2 != $game_actors[2].hp or @mp2 != $game_actors[2].mp or @hp3 != $game_actors[3].hp or @mp3 != $game_actors[3].mp or @hp4 != $game_actors[4].hp or @mp4 != $game_actors[4].mp
      @hud.refresh
      hud_vars
    end
  end
end

3.0
Código:
##############################################
################    HUD  ####################
##############################################
#uma hud com todos os herois da equipe que pode
#ser ativada/desativada com um switch
#============================================#
#---------------configuraçoes----------------#
#============================================#
class Scene_Map < Scene_Base
  alias config update
  def update
    config
    @hud.visible = $game_switches[1]#coloque aqui o id do switch condicional
    #se quiser que a hud fique sempre visivel, troque "$game_switches[1]" por "true"
  end
end
#============================================#
#----------------Script----------------------#
#============================================#
#nao mexa se nao tiver conhecimento de RGSS2
class HUD < Window_Base
  def initialize
    super (0,0,544,416)
    self.back_opacity = 0
    self.opacity = 0
    refresh
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      x = actor.index * 170 + 16
      draw_actor_graphic(actor, x, 60)
      draw_actor_hp(actor, x+ 16, 10)
      draw_actor_mp(actor, x+ 16, 40)
    end
  end
end
class Scene_Map < Scene_Base
  alias startHUD start
  alias terminateHUD terminate
  alias updateHUD update
  def start
    startHUD
    @hud = HUD.new
  end
  def hud_vars
    @hp1 = $game_actors[1].hp
    @mp1 = $game_actors[1].mp
    @hp2 = $game_actors[2].hp
    @mp2 = $game_actors[2].mp
    @hp3 = $game_actors[3].hp
    @mp3 = $game_actors[3].mp
    @hp4 = $game_actors[4].hp
    @mp4 = $game_actors[4].mp
  end
  def terminate
    terminateHUD
    @hud.dispose
  end
  def update
    updateHUD
    if @hp1 != $game_actors[1].hp or @mp1 != $game_actors[1].mp or @hp2 != $game_actors[2].hp or @mp2 != $game_actors[2].mp or @hp3 != $game_actors[3].hp or @mp3 != $game_actors[3].mp or @hp4 != $game_actors[4].hp or @mp4 != $game_actors[4].mp
      @hud.refresh
      hud_vars
    end
  end
end

demo:1.0 2.0 3.0
avatar
lasso
Ajudante de Administrador
Ajudante de Administrador

Mensagens : 14
Data de inscrição : 28/10/2010
Idade : 20

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum