The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: firerain on November 14, 2007, 01:19:38 AM

Title: Image in Window Question
Post by: firerain on November 14, 2007, 01:19:38 AM
Hey, quick scripting question.

I was wondering how I would make the icon of a certain weapon in my database appear next to the word 'Acquired'. I'm guessing I would need a few extra lines and something involving brackets []. Here is the code:

class Window_Popup < Window_Base
  def initialize
    super(0, 0, 250, 60)
    self.contents = Bitmap.new(width = 300, height = 32)
    refresh
  end
def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 180, 32, "Acquired")
    end
  end

Title: Re: Image in Window Question
Post by: shaz on November 14, 2007, 04:41:58 AM
have a look at the draw_item method in the Window_Item script.
Title: Re: Image in Window Question
Post by: modern algebra on November 14, 2007, 09:41:59 PM
Well, actually, the way Window_Status draws them might be a bit more appropriate as I assume you won't need to disable the text in your window. It uses the draw_item_name of Window_Base, which means it is very easy for you to do, though you will need to add an argument to refresh, namely the item that you want to draw.
Title: Re: Image in Window Question
Post by: firerain on November 14, 2007, 09:57:41 PM
Do you have a code example? I have no idea what I'm doing D:
Title: Re: Image in Window Question
Post by: modern algebra on November 14, 2007, 11:09:56 PM
Umm, the draw_item_name method in Window_Base has the code if you want to look at it.
Title: Re: Image in Window Question
Post by: Shinami on November 16, 2007, 07:37:26 AM
I did a full in-depth explanation of how to put icons in windows. CLICKY! (http://rmrk.net/index.php/topic,14366.0.html) Be sure to read the entire topic in the link I provided. That should get you going in the right direction.