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
#==============================================================================#
# * 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
#==============================================================================#