RPG Maker Forums

I'm working on a custom HUD which tracks some game variables and a few switches.  The problem comes from swapping a bitmap out for another (as this is an almost entirely graphical HUD).  When I go to clear my bitmaps they just vanish forever; even when I assign a picture to them immediately afterward.

There must be something I'm not getting -- I can't imagine why this isn't working properly and I can't figure another good way to do this.  This is my first custom HUD and I'm assembling it largely from scratch so I'm not sure if there's something I have to do here that I'm not doing.

Any help would be greatly appreciated.

Code:
module DIM  module HUD    X = 0    Y = 0    WIDTH = 240    HEIGHT = 64        FONT = ["Arial Narrow", "Impact"]    FONT_SIZE = 16    FONT_BOLD = false    FONT_ITAL = false        Opacity = 0  endend  class Window_HUD < Window_Base  include DIM::HUD    def initialize()    super( X, Y, WIDTH, HEIGHT)    self.contents = Bitmap.new(width-32,height-32)     self.back_opacity = 0    @hud_sprite = Sprite.new()    @status_bar_san_bg = Sprite.new()    @status_bar_san_fg = Sprite.new()    @mental_status = Sprite.new()    @danger = Sprite.new()    @saferoom = Sprite.new()    @siren = Sprite.new()    @time_rem = Sprite.new()    @status = Sprite.new()       @current_val = -1    refresh  end   def refresh    self.contents.clear    self.opacity = Opacity        #p "Refreshing"    @hud_sprite.bitmap = Cache.picture("status_bar")    @hud_sprite.z = 300        @status_bar_san_bg.bitmap = Cache.picture("status_bar_san_bg")    @status_bar_san_bg.x = 76    @status_bar_san_bg.y = 27    @status_bar_san_bg.z = 301        @status_bar_san_fg.bitmap = Cache.picture("status_bar_san_fg")    @status_bar_san_fg.x = 76    @status_bar_san_fg.y = 27    @status_bar_san_fg.z = 302        @mental_status.bitmap = Cache.picture("mental_status")    @mental_status.x = 56    @mental_status.y = 4    @mental_status.z = 300              if @current_val != -1      @status.bitmap.clear()      #p "Status bitmap cleared"    end        if @current_val != $game_variables[94]      p "New Status"      case $game_variables[94]      when 50 .. 60        @status.bitmap = Cache.picture("status_insane")        p "::STATUS ( Insane )"      when 40 .. 49        @status.bitmap = Cache.picture("status_losingit")        p "::STATUS ( Losing It )"      when 30 .. 39        @status.bitmap = Cache.picture("status_panicking")        p "::STATUS ( Panicking )"      when 20 .. 29        @status.bitmap = Cache.picture("status_frightened")        p "::STATUS ( Frightened )"      when 10 .. 19        @status.bitmap = Cache.picture("status_onedge")        p "::STATUS ( On Edge )"      when 1 .. 9        @status.bitmap = Cache.picture("status_suspicious")        p "::STATUS ( Suspicious )"      when 0        @status.bitmap = Cache.picture("status_collected")        p "::STATUS ( Collected )"      else        p "!!ERROR!! Invalid status"      end    end    @current_val = $game_variables[94]        @status.x = 68    @status.y = 14    @status.z = 400        if $game_switches[7] || $game_switches[14] || $game_switches[90] || $game_switches[91]      @danger.bitmap = Cache.picture("danger")    else      @danger.bitmap = Cache.picture("led_off")    end    @danger.x = 215    @danger.y = 6    @danger.z = 300        if $game_switches[89]      @saferoom.bitmap = Cache.picture("saferoom")    else      @saferoom.bitmap = Cache.picture("led_off")    end    @saferoom.x = 21    @saferoom.y = 11    @saferoom.z = 300        if $game_switches[91] || $game_switches[97] || $game_switches[98] || $game_switches[99]      @siren.bitmap = Cache.picture("siren")    else      @siren.bitmap = Cache.picture("led_off")    end    @siren.x = 5    @siren.y = 1    @siren.z = 300        @time_rem.bitmap = Cache.picture("time_remaining")    @time_rem.x = 168    @time_rem.y = 3    @time_rem.z = 300  end        def update    refresh    super  end   def terminate    super()  endend class Scene_Map < Scene_Base  alias DIMHUD_start start  def start    DIMHUD_start()    @hud = Window_HUD.new  end    alias DIMHUD_update update  def update    DIMHUD_update()    if $game_switches[82] == 1      @hud.update    end  endend

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,472
Members
137,822
Latest member
madelbylz
Top