🤔 Para Refletir :
"De pixel a pixel, os tiles compõem o Mapa."
- Core32

Plugin para exibição de variáveis.

Ludovic Masculino

Conde
Membro
Membro
Juntou-se
19 de Junho de 2015
Postagens
493
Bravecoins
24
Tempos atrás no RPG Maker VX Ace, eu usava um script simples de exibição de valores contidos em variáveis.
Isso me permitia fazer menus por eventos/pictures como no print abaixo
Eu tentei aqui, mas não consegui fazer o mesmo com o MV.

Alguém que manja pode dar uma olhada e me dizer que caminho seguir?

Estou deixando o script de VX Ace que eu usava
iyetUIz.png



Esse script fazia basicamente o seguinte: Exibia valores contidos em variáveis, nos quais eu adicionava uma linha quando queria mais um valor aparecendo, eu determinava X e Y de cada valor. Esses valores eram atualizados em tela.

Código:
###############################################################################
module Hud
#============================================================================== 
  MZ_HP  = 303
  MZ_AT  = 304
  MZ_DF  = 305
  MZ_AG  = 306
  MZ_BG  = 307
  MZ_CG  = 308
  MZ_SG  = 309
  MZ_OG  = 310
  MZ_LV  = 314
  MZ_HPP = 84 #HP Public Battle
  RK_NM  = 382
  RK_E   = 383
  RK_F   = 384
  RK_N   = 385
  RK_S   = 386
  RK_O   = 387
  RK_PF  = 388
  SWITCH    = 362 # Switch de visualização da hud
  MZ_STATUS = 363 # Menu Status
  MZ_GEM    = 364 # Menu Gems
  MZ_HP2    = 406 # HP in Battle
  RK_HUD    = 411 # Ranking HUD
  MZ_HP2X   = 452 # Ocultar HUD na fase Pseudo Exercito
#==============================================================================
end
###############################################################################
class Custom_HUD < Window_Base
#============================================================================== 
  def initialize
      super(0,0,640,480) # X,Y, Largura e altura da janela da hud
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Arial"
      self.contents.font.size = 20
      self.contents.font.bold = true
      self.opacity = 0
      self.z = 1500
      refresh
  end
#============================================================================== 
  def draw_hp
    if $game_switches[Hud::MZ_STATUS]
      self.contents.draw_text(284,60,128,32," " + $game_variables[Hud::MZ_HP].to_s,255)
    end
  end
 
  def draw_at
    if $game_switches[Hud::MZ_STATUS]
      self.contents.draw_text(170,90,128,32," " + $game_variables[Hud::MZ_AT].to_s,255)
    end
  end
 
  def draw_df
    if $game_switches[Hud::MZ_STATUS]
      self.contents.draw_text(170,120,128,32," " + $game_variables[Hud::MZ_DF].to_s,255)
    end
  end

  def draw_lv
    if $game_switches[Hud::MZ_STATUS]
      self.contents.draw_text(360,82,128,32," " + $game_variables[Hud::MZ_LV].to_s,255)
    end
  end 
#------------------------------------
  def draw_ag
    if $game_switches[Hud::MZ_GEM]
      self.contents.draw_text(443,100,128,32," " + $game_variables[Hud::MZ_AG].to_s,255)
    end
  end
 
  def draw_bg
    if $game_switches[Hud::MZ_GEM]
      self.contents.draw_text(443,155,128,32," " + $game_variables[Hud::MZ_BG].to_s,255)
    end
  end
  
  def draw_cg
    if $game_switches[Hud::MZ_GEM]
      self.contents.draw_text(443,210,128,32," " + $game_variables[Hud::MZ_CG].to_s,255)
    end
  end
 
  def draw_sg
    if $game_switches[Hud::MZ_GEM]
      self.contents.draw_text(443,265,128,32," " + $game_variables[Hud::MZ_SG].to_s,255)
    end
  end
  
  def draw_og
    if $game_switches[Hud::MZ_GEM]
      self.contents.draw_text(443,319,128,32," " + $game_variables[Hud::MZ_OG].to_s,255)
    end
  end
    
  def draw_hp2
    if $game_switches[Hud::MZ_HP2] and $game_switches[Hud::MZ_HP2X]
      self.contents.draw_text(15,35,128,64," " + $game_variables[Hud::MZ_HPP].to_s,255)
    end
  end
#---------------------------------------  
  def draw_nm
    if $game_switches[Hud::RK_HUD]
      self.contents.draw_text(194,36,128,64," " + $game_variables[Hud::RK_NM].to_s,255)
    end
  end
  
  def draw_e
    if $game_switches[Hud::RK_HUD]
      self.contents.draw_text(447,29,128,64," " + $game_variables[Hud::RK_E].to_s,255)
    end
  end
  
  def draw_f
    if $game_switches[Hud::RK_HUD]
      self.contents.draw_text(447,93,128,64," " + $game_variables[Hud::RK_F].to_s,255)
    end
  end
  
  def draw_n
    if $game_switches[Hud::RK_HUD]
      self.contents.draw_text(447,155,128,64," " + $game_variables[Hud::RK_N].to_s,255)
    end
  end
  
  def draw_s
    if $game_switches[Hud::RK_HUD]
      self.contents.draw_text(447,219,128,64," " + $game_variables[Hud::RK_S].to_s,255)
    end
  end
  
  def draw_o
    if $game_switches[Hud::RK_HUD]
      self.contents.draw_text(447,282,128,64," " + $game_variables[Hud::RK_O].to_s,255)
    end
  end
  
  def draw_pf
    if $game_switches[Hud::RK_HUD]
      self.contents.draw_text(427,366,128,64," " + $game_variables[Hud::RK_PF].to_s,255)
    end
  end
#==============================================================================   
  def refresh
    self.contents.clear
      draw_hp
      draw_at
      draw_df
      draw_ag
      draw_bg
      draw_cg
      draw_sg
      draw_og
      draw_lv
      draw_hp2
      draw_nm
      draw_e
      draw_f
      draw_n
      draw_s
      draw_o
      draw_pf
  end
end
#============================================================================== 
class Scene_Map < Scene_Base
  alias hud_hud_main main
    def main
      @neo_hud = Custom_HUD.new
      hud_hud_main
      @neo_hud.dispose
    end
   
    alias hud_hud_update update
    def update
      hud_hud_update
      if Graphics.frame_count % 4 == 0
        @neo_hud.update
        @neo_hud.refresh
      end
      @neo_hud.visible = $game_switches[Hud::SWITCH]
    end
end
#==============================================================================
 
Voltar
Topo Inferior