Hi everyone,
So I haven't made any scripts for a while, well, not any good ones, although I will admit I thought my Info. Cards script was pretty darn useful (Trainer Cards FTW !),
Not sure if you can remember, a while ago I made a HUD which looked pretty good visually, but because I never got the refresh rate done or anything, it lagged like a bitch, lol.
So now I'm releasing a NEW HUD;
Basically, when you press a button (Which can be assigned via the script) a box displaying your characters name, HP, SP and EXP will slide in from the left, and stay in the top left corner, until you release the button, simple yet effective;
Script ---
Code:
#==============================================================================
# ** JBrist Slide HUD - By JBrist of rmxp.org
#------------------------------------------------------------------------------
# Instructions of use :
#Â Â This is a simple plug and play script, just insert it into a new
#Â Â script above Main, and away you go. To show the HUD while ingame
#Â Â press the button which corrosponds to Z (Usually D), if you don't
#Â Â want it to be this, edit this line further down:
#
#Â Â Â Â @hudwindow.visible = Input.press?(Input::Z)
#
#Â Â Â Â Â Â Â Â Â Â Â Â Â Â JBrist
#=============================================================================
Â
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# Â This class is for all in-game windows.
#==============================================================================
Â
class Window_Base < Window
 #--------------------------------------------------------------------------
 # * Get the clear color.
 #--------------------------------------------------------------------------
 def clear_color
  return Color.new(0, 0, 0, 0)
 end
 #--------------------------------------------------------------------------
 # * Clear a certain number of pixel rows on the bitmap.
 #--------------------------------------------------------------------------
 def clear_rows(y, height)
  rect = Rect.new(0, y, width - 32, height)
  self.contents.fill_rect(rect, clear_color)
 end
 #--------------------------------------------------------------------------
 # * Specialized hud drawing stats.
 #--------------------------------------------------------------------------
 def specialized_draw_hud(x, y, left, right, height = 24)
  self.contents.font.color = system_color
  self.contents.draw_text(x, y, 60, height, left)
  self.contents.font.color = normal_color
  self.contents.draw_text(x, y, width - 32, height, right, 2)
 end
end
Â
#==============================================================================
# ** Jbrist_HUD
#------------------------------------------------------------------------------
# Â This class performs hud processing when on Scene_Map.
#==============================================================================
Â
class Jbrist_HUD < Â Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  super(0, 0, 260, 130)#210, 130
  self.contents = Bitmap.new(width - 32, height - 32)
  self.back_opacity = 255
  # Not visible by default.
  self.visible = false
 Â
  self.contents.fill_rect(0, 24, width - 32, 2, system_color)
  # Save the actor that will be doing the drawing for.
  @actor = $game_party.actors[0]
  refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
  # Drawing values.
  x, y, height_inc = 0, 0, 24
 Â
  # Draw the Name of the Party Leader.
  if @actor_name != @actor.name
   # Save the new value
   @actor_name = @actor.name
   # Create a rectangle to clear the portion we will draw to.
   clear_rows(y, height_inc)
   # Draw the actors name.
   specialized_draw_hud(x, y, "Name", @actor.name)
  end
 Â
  y += height_inc + 2
 Â
  # Draw the Hitpoints of the Party Leader.
  if @actor_hp != @actor.hp
   # Save the new value
   @actor_hp = @actor.hp
   # Create a rectangle to clear the portion we will draw to.
   clear_rows(y, height_inc)
   # Draw the health points.
   hp_str = @actor.hp.to_s + ' / ' + @actor.maxhp.to_s
   specialized_draw_hud(x, y, 'HP', hp_str)
  end
 Â
  y += height_inc
 Â
  # Draw the Skill Points of the Party Leader.
  if @actor_sp != @actor.sp
   # Save the new value
   @actor_sp = @actor.sp
   # Create a rectangle to clear the portion we will draw to.
   clear_rows(y, height_inc)
   # Draw the skill points.
   sp_str = @actor.sp.to_s + ' / ' + @actor.maxsp.to_s
   specialized_draw_hud(x, y, 'MP', sp_str)
  end
 Â
  y += height_inc
 Â
  # Draw the Experience of the Party Leader.
  if @actor_exp != @actor.exp
   # Save the new value
   @actor_exp = @actor.exp
   # Create a rectangle to clear the portion we will draw to.
   clear_rows(y, height_inc)
   # Draw the experience.
   exp_str =  @actor.exp.to_s + ' / ' + @actor.next_exp_s
   specialized_draw_hud(x, y, 'Exp.', exp_str)
  end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  @actor = $game_party.actors[0]
  refresh
 end
end
Â
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# Â This class performs map screen processing.
#==============================================================================
Â
class Scene_Map
 alias_method :jbri_hudwindow_main, :main
 alias_method :jbri_hudwindow_update, :update
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
  @hudwindow = Jbrist_HUD.new
  jbri_hudwindow_main
  @hudwindow.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  @hudwindow.update
  @hudwindow.visible = Input.press?(Input::Z)
  if @hudwindow.visible
   if @hudwindow.x < 0
    @hudwindow.x += @hudwindow.width / 10
    @hudwindow.opacity += @hudwindow.width / 10
   end
  else
   @hudwindow.x = @hudwindow.width * -1
   @hudwindow.opacity = 255 - @hudwindow.width
  end
  jbri_hudwindow_update
 end
end
Â
Â
Instructions ---
It's basically a Plug n' Play script, so you shouldn't find it too difficult, if you'd like to change which button opens the HUD, it's all in the script for you, but I'll paste the line anyways;
@hudwindow.visible = Input.press?(Input::Z)
And thats it.
Compatability ---
I have NO idea about the compatability, I'm guessing it'll work with everything cause it doesn't edit any classes or anything like that.
Credit ---
Yeah, if you use, just credit me as JBrist, cheers.
And thats the script, feedback ?