show variables on screen rpg maker xp
#16
certainly

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 Grinning
Reply }


Messages In This Thread
RE: show variables on screen rpg maker xp - by ThePrinceofMars - 10-17-2014, 10:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Scan skill should show states Tumen 5 9,211 05-02-2017, 03:33 AM
Last Post: DerVVulfman
   Display State Ranks in Status Screen Mel 3 7,412 04-02-2017, 12:46 AM
Last Post: marketing small business ideas
   RMXP SKill animations too bright (overlaying the battle screen) Starmage 4 10,152 06-13-2016, 03:41 AM
Last Post: Starmage
   Custom Save/Load screen Raou 2 7,556 04-01-2015, 08:18 PM
Last Post: Raou
   Game Variables List for Copy/Paste JayRay 4 7,000 01-15-2015, 06:18 AM
Last Post: JayRay
   in FPLE touching events after battle causes rpg maker to crash ThePrinceofMars 1 5,503 11-27-2014, 09:11 PM
Last Post: MechanicalPen
   Script Request - Variables Specific Save File JayRay 2 5,109 04-28-2014, 05:15 AM
Last Post: JayRay
   Help with Shop Menu [RPG Maker XP] JackMonty 6 12,970 05-23-2013, 10:14 AM
Last Post: JackMonty
   Analyse show HP Bars Ace 12 16,841 12-28-2010, 04:39 PM
Last Post: Ace
   Showing the evade stat in the status screen corpsegirl 2 6,279 10-25-2010, 11:40 PM
Last Post: corpsegirl



Users browsing this thread: 1 Guest(s)