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.
RMVX icons to RMXP

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 41
RMRK Junior
I was wondering if someone could separate this group of icons into single icons. I hope it isn't too much to ask :( I'll leave an attachment of the file.

**
Rep:
Level 74
RGSS Scripter
I've created a script which splits the IconSet file you decide into separate icons :)
Use it if you want to split another IconSet files :)
I've already split yours. See the attachments :)

Code: [Select]
#==============================================================================#
# * IconSet Splitter (By XaXaV)                                                #
#------------------------------------------------------------------------------#
XXV_IconSplit_Filename = "IconSet" # The file should be in the game directory.
#==============================================================================#
class Bitmap
 
  def print_out(id)
    name = "XSIcon-#{id}"
    File.open("./XSIcons/#{name}.png", "wb") do |f|
      f.write("\211PNG\r\n\032\n" + png_ihdr + png_idat + "\000\000\000\000IEND" + [Zlib.crc32("IEND")].pack('N'))
    end
    return "#{name}.png"
  end
 
  def png_ihdr
    string = "IHDR" + [self.width].pack("N") + [self.height].pack("N") + "\010\006\000\000\000"
    ih_crc = [Zlib.crc32(string)].pack("N")
    return "\000\000\000\r" + string + [Zlib.crc32(string)].pack("N")
  end
 
  def png_idat
    data = Zlib::Deflate.deflate(make_png_data, 8)
    return [data.length].pack("N") + "\x49\x44\x41\x54" + data + [Zlib.crc32("\x49\x44\x41\x54" + data)].pack("N")
  end
 
  def make_png_data
    data = []
    for y in 0...self.height
      data.push(0)
      for x in 0...self.width
        color = self.get_pixel(x, y)
        data.push(color.red, color.green, color.blue, color.alpha)
      end
    end
    string = data.pack("C*")
    data.clear
    return string
  end
 
end
#------------------------------------------------------------------------------#
Dir.mkdir("./XSIcons") rescue nil
$prog = Sprite.new
$prog.bitmap = Bitmap.new(416, 24)
$prog.x = (Graphics.width - 416)/2
$prog.y = (Graphics.height - 24)/2
$prog.bitmap.clear
$ind = 1

iconset = Bitmap.new("./#{XXV_IconSplit_Filename}")
max = ((iconset.width/24)*(iconset.height/24))
for i in 0...max
  Graphics.update
  $prog.bitmap.clear
  $prog.bitmap.draw_text(0, 0, 416, 24, "#{$ind}/#{max}", 1)
  out = Bitmap.new(24, 24)
  src = Rect.new(i % 16 * 24, i / 16 * 24, 24, 24)
  out.blt(0, 0, iconset, src)
  out.print_out(i)
  out.dispose
  $ind += 1
end
$prog.dispose
#==============================================================================#
I'm crazy as much as I want to be.

**
Rep: +0/-0Level 41
RMRK Junior
OMG you are such a huge help. You're like my bestfriend right now lol. Thanks a bunch!  :tpg:

**
Rep: +0/-0Level 41
RMRK Junior
line 46: $prog.x = (Graphics.width - 416)/2

I'm having a problem with this line. :)

**
Rep:
Level 74
RGSS Scripter
I'm glad to help :)

That error raises because you are maybe using RMXP... Don't you?
If so, change  Graphics.width  with  640  and  Graphics.height  with  480
That should fix it :)
I'm crazy as much as I want to be.

**
Rep: +0/-0Level 41
RMRK Junior
Thanks so much. You are so help! :)

**
Rep:
Level 74
RGSS Scripter
:) If you need anything else just tell me ;)
I'm crazy as much as I want to be.