#===== Rpg Makver VX ACE Script =============================
#= Simple Hud
#===== By: ==================================================
#= lilcooldude69
#===== Current Version: =====================================
#= 1.0
#===== Compatible With: =====================================
#= Rpg Maker VX ACE
#===== Description: =========================================
#= Sells items useful for 2-2 Classes
#===== Additional Comments: =================================
#=
#============================================================
module Hud_config
#Configuration
SWITCH = 1 #the number of the switched used to make it visible Example: if this is 1 then Switch 001 will turn on the hud.
#EXPTERM = "Exp" #Term used for The Exp Bar
#GOLD = "G" #Term used for the Gold, You may have to make adjustments below if > 1 character
OPACITY = 200 #used for the opacity of the window, Mess with this to your liking :P
SHOW_EQUIP = 0 # The equipment piece shown. This is the slot ID.
# 0 = weapon
# 1 = shield
# 2 = head
# 3 = body
# 4 = accessory
#end config
end
#=====DO NOT EDIT PAST HERE UNLESS YOU KNOW WHAT YOUR DOING======#
#=================EXCLUDING WHAT WAS SAID ABOVE==================#
include Hud_config
class Window_Hud < Window_Base
#----------------------------------------------------
# * Object Initialization
#----------------------------------------------------
def initialize
super(0,3,255,70)
self.windowskin = Cache.system("Window_HUD")
self.back_opacity = 255
create_contents
self.visible = $game_switches[SWITCH]
@actor = $game_party.members[0]
refresh
end
def exp_gauge_color1; text_color(31); end;
def exp_gauge_color2; text_color(27); end;
#----------------------------------------------------
# * Refresh
#----------------------------------------------------
def refresh
self.contents.clear
contents.clear
draw_window_content
end
#----------------------------------------------------
# * Draw Window Contents * Drawing of all the contents gold, hp bar, etc
#----------------------------------------------------
def draw_window_content
@gold = $game_party.gold
@level = @actor.level
@hp = @actor.hp
@mp = @actor.mp
@tp = @actor.tp
@exp = @actor.exp
draw_face(@actor.face_name, @actor.face_index, 5, -20, enable = false)
contents.font.size = 20
#draw_actor_name(@actor, 0, 0)
#draw_actor_level(@actor, 45, 0)
draw_actor_hp(@actor, 112, -6, 102)
#draw_exp(@actor, 0, 60, 102)
#draw_actor_mp(@actor, 55, 17, 48)
draw_actor_mp(@actor, 112, 14, 102)
#==========Make the Adjustment here if you edited the GOLD variable to be longer than 1 Character===============
contents.font.size = Font.default_size
#draw_currency_value(@gold, GOLD, 0, 82, 102)
#draw_currency_value(Gold Variable, Term Variable, X-pos, Y-Pos, Width) change the width if you make the term longer than 1 char
#example, draw_currency_value(@gold, GOLD, 0, 155, 110)
#==========Make the Adjustment here if you edited the GOLD variable to be longer than 1 Character===============
end
#-----------------------------------------------------
# * Update * used to keep things up to date
#-----------------------------------------------------
def update
super
self.visible = $game_switches[SWITCH]
return if !self.visible
if @level != @actor.level or @hp != @actor.hp or @mp != @actor.mp or
@tp != @actor.tp or @exp != @actor.exp or @gold != $game_party.gold
refresh
end
end
#-----------------------------------------------------
# * Custom Definition for the experience bar free to use if you like
#-----------------------------------------------------
def draw_exp(actor, x, y, width = 124)
s1 = @actor.max_level? ? "---------" : @actor.exp
s2 = @actor.max_level? ? "---------" : @actor.next_level_exp - @actor.exp
if @actor.max_level? ? draw_gauge(x, y, width, 1, exp_gauge_color1, exp_gauge_color2)
:
draw_gauge(x, y, width,(((actor.exp.to_f/100) / (actor.next_level_exp.to_f/100)) * 100),
exp_gauge_color1, exp_gauge_color2)
end
change_color(system_color)
#draw_text(x, y, 30, line_height, EXPTERM)
change_color(text_color(27))
if @actor.max_level? ? draw_text(x + width - 72, y, 72, line_height, "------------", 2)
:
draw_text(x + width - 72, y, 72, line_height, actor.next_level_exp.to_i - actor.exp.to_i, 2)
end
end
end
#------------------------------------------------------
# * Scene_Map Class, For keeping it on the map
#------------------------------------------------------
class Scene_Map < Scene_Base
alias start_window start
alias term_window terminate
alias update_window update
def start
start_window
@winhud = Window_Hud.new
update
end
def terminate
@winhud.dispose
term_window
end
def update
update_window
@winhud.update
end
end