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 Item Icon picture in Gold window

this should just be a small script.

Anyways, what im asking for is a script that allows you to place an image in the Gold Window in place of the words (the default would be 'G'). and that's it!
 
Code:
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================

class Window_Gold < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 1, 131-cx-2, 32, $game_party.gold.to_s, 2)
icon = RPG::Cache.icon("032-item01")
src_rect = Rect.new(0, 0, 32, 32)
self.contents.blt(104, 5, icon, src_rect)
end
end

This is the script that you should need, just replace it with the one that is in Window_Gold

You will also need to have the icon in 'Pictures/Icons'

Hope this helps
 

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