ddrillini / Simply-Love-SM5

A fork of Simply Love, to hold DDRIllini's tweaks.
http://ddrillini.club
MIT License
6 stars 2 forks source link

merge upstream: add qrencode.lua to ./Scripts #40

Closed ianklatzco closed 5 years ago

ianklatzco commented 5 years ago

This commit pulls in the qrencode.lua library from https://github.com/speedata/luaqrcode adding one tiny little function to the bottom to make it usable for SM5. Nothing in the theme uses this yet, but it's there.

This was requested.

If you want to learn more about implementing QR codes, this is a great tutorial on that topic: https://www.thonky.com/qr-code-tutorial/


There is now a global function qrcode_amv() that accepts two arguments.

• string to be encoded • size in pixels of the output QR code (it will be a square, so 1 dimension suffices)

qrcode_amv() returns an ActorMultiVertex encoded with the data provided in the first argument, scaled to the size provided in the second argument.


SM5 usage might go like this:

local url = "https://www.youtube.com/watch?v=-kFOXP026eE&list=PLS3_1JNX8dEh5YcO-Y05stU0u_T9nqIlF" local qrcode_size = 160

af[#af+1] = qrcode_amv( url, qrcode_size )..{ OnCommand=function(self) self:xy(-28,190) end }


"I can never say what I want to say," continued Naoko. "It’s been like this for a while now. I try to say something, but all I get are the wrong words—the wrong words or the exact opposite words from what I mean. I try to correct myself, and that only makes it worse. I lose track of what I was trying to say to begin with. It’s like I’m split in two and playing tag with myself. One half is chasing the other half around this big, fat post. The other me has the right words, but this me can’t catch her."