#==============================================================================
# ** Window_HUD
#------------------------------------------------------------------------------
#
# Variable - Change this number if you want to have another variable displayed
# instead of variable 10.
#
#==============================================================================
class Window_HUD < Window_Base
Variable = 10
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
#
# self.opacity - this is the opacity of the window, (0-255).
# 0 means that the window is fully transparent.
#
# self.visible = false - this will make the window invisible by default.
# Further down you will see the setup that will
# make the window show when switch 1 is ON.
#--------------------------------------------------------------------------
def initialize
super(490, 0, 150, 70)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.visible = false
@variable = $game_variables[Variable]
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
#
# Here you can change this line to choose where on the screen the variable
# should be displayed.
#
# You should change this line:
# self.contents.draw_text(50, -10, 52, 52, @variable.to_s, 0)
#
# Here is the same line but with explination on what everything does:
# self.contents.draw_text(x, y, width, height, @variable.to_s, align)
#
# x - the x position of the variable
# y - the y position of the variable
# width - the width of the variable, 32 is the lowest, and it should probably
# be something higher or else the number will look squashed when it
# reaches 100.
# height - the height of the variable. 32 is the lowest.
# align - the alignment, 0 = left, 1 = center, 2 = right.
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(50, -10, 52, 52, $game_variables[10].to_s, 0)
end
def update
super
refresh if @variable = $game_variables[Variable]
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# if $game_switches[1] == true - this line is there to make sure that the va
#==============================================================================
class Scene_Map
alias yourhud_main main
alias yourhud_update update
def main
@yourhud = Window_HUD.new
yourhud_main
@yourhud.dispose
end
def update
if $game_switches[1] == true
@yourhud.visible = true
else
@yourhud.visible = false
end
@yourhud.update
yourhud_update
end
end