28 posts
Location
Somewhere in Nowhere
Posted 11 March 2017 - 03:27 PM
I've been looking arround for a API/Library/Program that is able to convert PNG / GIF / JPEG / .. to a drawable image in-game. but with no success.
if anyone could like me a API or something that could help me further, that would be kindly appreciated!
(if your wondering why, i found a website that will generate QR codes with a http.get request, and will download the image)
218 posts
Location
tmpim
Posted 11 March 2017 - 05:27 PM
Bomb Bloke has a GIF API
here
Edited on 11 March 2017 - 04:28 PM
34 posts
Posted 11 March 2017 - 08:52 PM
This is a qr code generating API, it doesn't draw it for you, it returns a 2d table.
You could draw this by using something similar to this code
qrencode = dofile("qrencode.lua")
local success, table = qrencode.qrcode("string to be encoded")
if success then
for x, row in ipairs(table) do
for y, value in ipairs(row) do
--draw white or black square depeding on value
end
end
else
print("Error")
end
Edited on 11 March 2017 - 07:52 PM
7083 posts
Location
Tasmania (AU)
Posted 12 March 2017 - 04:10 AM
(if your wondering why, i found a website that will generate QR codes with a http.get request, and will download the image)
Unless that website offers text-based downloads, you'll have trouble getting CC's http API to handle its output - and if it
does, then you likely won't need a GIF/JPG/whatever API.
Using a local generator such as the one FuzzyLitchi linked seems a better idea.