Main Menu
  • Welcome to The RPG Maker Resource Kit.

Image in Window Question

Started by firerain, November 14, 2007, 01:19:38 AM

0 Members and 1 Guest are viewing this topic.

firerain

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


shaz

have a look at the draw_item method in the Window_Item script.
Always remember you're unique.
Just like everybody else.

modern algebra

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.

firerain

Do you have a code example? I have no idea what I'm doing D:

modern algebra

Umm, the draw_item_name method in Window_Base has the code if you want to look at it.

Shinami

I did a full in-depth explanation of how to put icons in windows. CLICKY! Be sure to read the entire topic in the link I provided. That should get you going in the right direction.