Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Show Icon When Empty

Hey, I was wondering if somebody could script me a code that will display an empty icon [and if possible the word EMPTY next to it] when nothing is equipped on one of the hero's equipment slots... So, if anyone could, I'd give them credit and it would be really appreciated.

Thanks!
Koops
 
Like this?

Code:
EMPTY_ICON = "001-Weapon01"
EMPTY_NAME = "EMPTY"

class Window_Base
  #--------------------------------------------------------------------------
  # * Draw Item Name
  #     item : item
  #     x    : draw spot x-coordinate
  #     y    : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y)
    if item == nil
      bitmap = RPG::Cache.icon(EMPTY_ICON)
      item_name = EMPTY_NAME
    else
      bitmap = RPG::Cache.icon(item.icon_name)
      item_name = item.name
    end
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 32, item_name)
  end
end

Use any icons in Graphics/Icons folder.
The only thing is that Status window will be affected too...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top