Hi everyone!
I am embedding some icons in my app, i want to convert them into text, but i cant find back the awsome converters that some of you have posted recently. Can someone post the adequate link?
Or even better: has anyone a full set of icons ready to use in text coding he wants to share?
Thanks for your help.
EDIT: i found it back: it is the RLE compressor from @Ignatz
Finally i found the text coding too much text.
So i made this little utility to get the icons i need
I get the icon set from a free web source below (downloaded only once).
You select the icon, then save with the name you want.
--# Main
-- test icon web
-- Use this function to perform your initial setup
function setup()
local url = "http://media.smashingmagazine.com/wp-content/uploads/2012/12/icons-preview.png"
x0,y0=0,0
img0 = readImage("Documents:icons")
if img0 then start() else http.request(url,save) end
end
function start()
collectgarbage()
img0 = readImage("Documents:icons")
img = image(14*34,15*34)
setContext(img)
noSmooth()
for x=1,14 do
for y=1,15 do
ico = getIcon(x,y)
sprite(ico,(x-1)*34+16,(y-1)*34+16)
end
end
setContext()
setContext(ico)
background(255, 255, 255, 255)
setContext()
parameter.text("name","icon-xxx")
parameter.action("save selected icon",function()
saveImage("Documents:"..name,getIcon(x0+1,y0+1))
print("image saved to : "..name)
end)
end
function getIcon(nx,ny)
local w,h = 77,62
if nx<0 then nx=0 end
if nx>14 then nx=14 end
local x1 = w*(nx-1) +1
if ny<0 then ny=0 end
if ny>15 then ny=15 end
local y1 = h*(ny-1) +1
local icon = img0:copy(x1,y1,32,32)
return icon
end
function save(img)
saveImage("Documents:icons",img)
start()
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(255, 82, 0, 255)
fill(255, 255, 255, 255)
fontSize(20)
if ico then
text("tap the icon you want then save it to your documents",WIDTH/2,HEIGHT*7/8)
noSmooth()
spriteMode(CORNER)
sprite(ico,WIDTH/8+34*x0,HEIGHT/8+34*y0)
sprite(img,WIDTH/8,HEIGHT/8)
else
text("wait for the image to be downloaded...",WIDTH/2,HEIGHT*7/8)
end
end
function touched(touch)
local x,y = touch.x,touch.y
x0,y0 = math.floor((x-WIDTH/8)/34),math.floor((y-HEIGHT/8)/34)
end