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)
0
trying to convert PNG to drawable image
Started by lolmaker2002, Mar 11 2017 03:27 PM
3 replies to this topic
#1
Posted 11 March 2017 - 03:27 PM
#3
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
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 by FuzzyLitchi, 11 March 2017 - 08:52 PM.
#4
Posted 12 March 2017 - 04:10 AM
lolmaker2002, on 11 March 2017 - 03:27 PM, said:
(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.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users