Help - Search - Members - Calendar
Full Version: Enable Single Icon Usage
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
snstar2006
CODE
class Window_Base
  def draw_icon2(icon_file, x, y, enabled = true)
    bitmap = Cache.load_bitmap("Graphics/Icons/", icon_file)
    rect = Rect.new(0, 0, 24, 24)
    self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
  end
  
  def draw_item_name(item, x, y, enabled = true)
    if item != nil
      if item.get_icon
        draw_icon2(item.get_icon.to_s, x, y, enabled)
      else
        draw_icon(item.icon_index, x, y, enabled)
      end
      self.contents.font.color = normal_color
      self.contents.font.color.alpha = enabled ? 255 : 128
      self.contents.draw_text(x + 24, y, 172, WLH, item.name)
    end
  end
end

module Item
  ICON = /<ICON*(.*)>/i
end

class RPG::BaseItem
  def get_icon
    self.note.split(/[\r\n]+/).each { |line|
      if line =~ Item::ICON
        a = line.split(/ /)[1]
        d = ""
        while ((c = a.slice!(/./m)) != nil)
          d += c if c != ">"
        end
        return d
      end
    }
    return nil
  end
end


in the meno of skill, item, armor or weapon, write:

<ICON filename>

create a new folder and call it "Icons"
put the icon files in the folder

if nothing is written in the memo, then the original icon set from the iconset is used
ERZENGEL
Wooow! I can't code such a script and I don't know why this wasn't answered. Maybe this is useful for someone but not for me at the moment. Very good work.
woratana
Sweet! >_</

I always have a problem when counting Icon Index tongue.gif This will help a lot smile.gif
Hisakata
Ok, since I'm a newb at this....can you tell me what you mean by writing <ICON filename> in the meno - or where the nemo is located

thank you
Netto
QUOTE (Hisakata @ Jul 16 2008, 04:12 PM) *
Ok, since I'm a newb at this....can you tell me what you mean by writing <ICON filename> in the meno - or where the nemo is located

thank you

I think he means the notes section in the database when you click on an item/armor/weapon.
Hisakata
QUOTE (Netto @ Jul 16 2008, 04:19 PM) *
QUOTE (Hisakata @ Jul 16 2008, 04:12 PM) *
Ok, since I'm a newb at this....can you tell me what you mean by writing <ICON filename> in the meno - or where the nemo is located

thank you

I think he means the notes section in the database when you click on an item/armor/weapon.



Thank you, That helped
dark-kaineru
This plus SRC weapon Icons is equal to.... HEHEHEHEHEHEHEHE
RoxasXIII
Wow...I've wanted this since I was a newb...Don't mind my un-enthusiastic attitude... Wooo Hooo!!! Yay! Im gonna virtually party!!!
I'm probably gonna get warn for this, but o well...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.