10-17-2014, 10:01 PM
certainly
and thanks again with your help were going to make something amazing I know it
Code:
#==============================================================================
# ** Window_YourHUD
#------------------------------------------------------------------------------
# This Window displays relavent values to the player during gameplay.
# by emeraldcyndaquil
#==============================================================================
class Window_YourHUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 64)
self.opacity = 0
self.contents = Bitmap.new(640 - 32, 64 - 32)
refresh
end
#--------------------------------------------------------------------------
# * Draw Variable
#--------------------------------------------------------------------------
def draw_variable(x, y)
self.contents.draw_text(x, y-16, self.width, self.height,
$game_variables[1].to_s)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
reset_variables
return if !@actor
draw_actor_hp(@actor, 0, 0)
draw_actor_sp(@actor, 250, 0)
draw_actor_exp(@actor, 400, 0)
draw_variable(200, 0)
end
#--------------------------------------------------------------------------
# * Reset Stored Variables
#--------------------------------------------------------------------------
def reset_variables
@actor = $game_party.actors[0]
@old_hp = @actor ? @actor.hp : 0
@old_maxhp = @actor ? @actor.maxhp : 0
@old_sp = @actor ? @actor.sp : 0
@old_maxsp = @actor ? @actor.maxsp : 0
@old_ammo = $game_variables[1]
end
#---------------------------------------------------------------------------
# * Update (called once a frame)
#---------------------------------------------------------------------------
def update
super
refresh if (@actor != $game_party.actors[0] or
@old_hp != @actor ? @actor.hp : 0 or
@old_maxhp != @actor ? @actor.maxhp : 0 or
@old_sp != @actor ? @actor.sp : 0 or
@old_ammo != $game_variables[1] or
@old_maxsp != @actor ? @actor.maxsp : 0)
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# We've edited this to add a HUD
#==============================================================================
class Scene_Map
#---------------------------------------------------------------------------
# * Alias Listings (fixes F12 bug)
#---------------------------------------------------------------------------
unless method_defined?(:yourhud_main)
alias_method(:yourhud_main, :main)
alias_method(:yourhud_update, :update)
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@yourhud = Window_YourHUD.new
yourhud_main
@yourhud.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@yourhud.update
yourhud_update
end
end
and thanks again with your help were going to make something amazing I know it