Ported "Input" examples from Processing#12
Conversation
Ported all examples under the Input section of the Processing examples website.
|
Excellent! I look forward to reviewing these. It's late here and so this should be reviewed with fresh eyes, but my instinct is that it might be easier to use string.match like local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if string.match(key, "^[A-Z]$") then
keyIndex = string.find(alphabet, key) - 1
letterHeight = maxHeight
fill(colors[keyIndex])
elseif string.match(key, "^[a-z]$") then
keyIndex = string.find(alphabet, string.upper(key)) - 1
letterHeight = minHeight
fill(colors[keyIndex])
else
fill(0)
letterHeight = 10
endhmmm. maybe not! after writing all that, i don't think it saves any code! maybe there's an even more idiomatic way to do it?
I really appreciate the effort here and I think the best place to put these is on the L5 website itself by building out the Examples page there. It would be nice to have it follow the design of Processing's example page or p5's example page. My apologies on the additional work suggestion. I should perhaps either retire this section or add a note that examples go there. Thanks for all your contributions! |
|
We can pull these in after the L5-website merge, making sure these are copies of those! |
Matched the revised input examples in the L5 website, with proper crediting/licensing. Cleaned up unrelated L5.lua and main.lua changes for another issue
|
Looks like L5.lua, main.lua and TODO.txt got pulled in by mistake, and an extra .../beginShapeTrianglsWithTexture.lua — can you revert those files to match main? Rest of examples ok! Thank you. Almost there. |
|
Got it! I think it was because my fork wasn't synced with main after the other PRs got merged. Thank you for being so patient with me! Should be all set now. |
|
Thanks for your work on this! |
Ported all examples under the Input section of the Processing examples website
https://processing.org/examples/
Specifically, the adapted examples were: Clock, Constrain, Easing, Keyboard, Keyboard Functions, Milliseconds, Mouse 1D, Mouse 2D, Mouse Functions, Mouse Press, Mouse Signals and Storing Input.
There was feature parity on most input examples in processing, with just two trivial small difference:
as opposed to