RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Image in Window Question

0 Members and 1 Guest are viewing this topic.

*
Meet me in the middle
Rep:
Level 89
or left of the dial.
For frequently finding and reporting spam and spam botsSecret Santa 2012 Participant
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:

Code: [Select]
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


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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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.

*
Meet me in the middle
Rep:
Level 89
or left of the dial.
For frequently finding and reporting spam and spam botsSecret Santa 2012 Participant
Do you have a code example? I have no idea what I'm doing D:

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Umm, the draw_item_name method in Window_Base has the code if you want to look at it.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
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.