Li'l Craft UPDATED

[EDIT: added “Li’l Viewers”]

Hi all, I hope this will help many people.

These are super-simplified versions of a couple of the built-in demo projects.

All the code has been vastly stripped down, and heavily commented, to make it super easy to follow. This is something I usually do for myself to learn how things work.

I hope sharing these will be good for others like me who need to take smaller steps.

This is “Li’l Learn Craft”, adapted from “Learn Craft”:
https://gist.github.com/DolenzSong/24c33f889f06f98ac2af98b31ddc19b3

This is “Li’l Viewers”, adapted from “Cameras”:
https://gist.github.com/DolenzSong/48d192d43dfb055fe47bf1505feb1374

Installation notes:

  • the projects must have Craft as a dependency or they will not work.
  • “Li’l Learn Craft” additionally must have Cameras as a dependency
  • to copy any project into Codea, copy the source code from the webpage, and then press and hold on the New Project “+” icon. You will see an option appear that says “Paste into project”. Choose it. Doing it this way sets up the project tabs for you.

P.S.: If you find these helpful, please leave a comment, so they can stay near the top of the forums, for newcomers.

@UberGoober seems to be a problem with a line in the startTab() function


loadstring(readProjectTab(tabName))()

~~

Are we missing a function?

You get an error there? Na me.

Yeah Codea says there is an error on that line. No time to find it so just flagged it up.

I forgot to mention that the project requires Cameras and Craft as dependencies to run. I edited the original post so it mentions that. If you would, please try doing that, and let me know if it helps or not.

Tried Craft will try Cameras later.

@UberGoober For anyone using this, instead of the code being copied to a project, it needs paste into project so that it creates all of the different tabs instead of just the Main tab.

Ooo good point @dave1707 ! I’ll edit to accommodate it.

@UberGoober , @dave1707 - thanks for this, didn’t have much free time to play around with it - obviously pasted into a blank page not as project, like the way it’s arranged and can now see a broader use of Craft.

Just added “Li’l Viewers” to the above post. It’s another simplified version of a Craft sample project.

@UberGoober - thanks for the new demo, I had a problem with it when you touch the buttons you get an error on line 94 which involves the touches.handlers. It can be resolved by adding Viewers as a dependency - I’d add a note to that in your code next to the Craft dependency note.

@Bri_G good call!

The Touches project is actually what was vital (Cameras uses it), and it’s small so I just copy/pasted it into the project itself.