Basic Etch-a-Sketch project

Yesterday, I felt like launching Codea, which is something I don’t do frequently since I’m not a dedicated person, and then started coding something like an Etch-a-Sketch app. Four hours later, I got this result and today I felt like sharing it, in case any of you feels like giving it a try.

The code’s pretty basic and rough, and I’m pretty sure many of you might find easier or more optimal and advanced methods to perform the same thing, or improved versions of it, but I’m not exactly looking for feedback since I wouldn’t understand most of it anyway.

It’s still missing things, like limiting the area where the stylus pointer may go or an in-app color selector (which I might add at a later time, even though the actual toy doesn’t have such feature).

To use it, just slide your fingers left/right on the ★☆ knobs (I might experiment adding a two-fingers per knob and see if it helps with reducing shakiness when drawing curves/diags; if it doesn’t help, I’ll leave it in its current state). I added a “lift stylus” (lifted by default; toggle by tapping anywhere between above the base of the drawing area and HEIGHT/2; the rectangle at the top is just an indicator) option in order to be able to move the drawing point towards a desired location, using a grid and vertical/horizontal position guides (since the dot disappears to avoid drawing), before starting to sketch and/or to draw separate shapes (another feature the real toy doesn’t have), in case you feel like it. In order to clear the canvas, just restart the simulation (shaking your device won’t do anything [yet?]).

Without further ado, I present to you this thing: (1.7 KB)


@sebgo Nice little program. I had to change “else fill(255,0)” in Trazo to “else fill(255)” to get it to draw a line. You’re correct that it can take a lot of changes to reduce the size and add more options.

1 Like

I set it as a “lift stylus” option that’s enabled by default. That’s why it won’t draw from the start. I know the real toy works under a lineographic principle, but I wanted it to have the ability to draw independent shapes without a trace that joins them in the middle. To start drawing and toggle between draw/lift all you need to do is tap slightly above the base of the canvas.

Saw this when you posted on discord. Such a cool retro project. Hope you don’t mind but I reposted your video here

1 Like

I wanted to post one, but I was having serious connectivity issues. So, thanks for sharing it!

1 Like