I want to make some way to compose "drawing" or "graphic" values -- lines, rectangles, circles, arcs, ... groups, ... (with a bitmap image as just one special case) each with colored fills, borders, etc. -- and to eventually draw the result on the stage (or actually, in the workspace as a displayable value).
I can build the values by manually writing abstract data types represented as lists, awkward but workable. I cannot find a way to paint the result.
you can simulate drawing on a sprite by changing the costume of the drawing sprite to a small dot, and then use the paste on block to paste the drawing sprite on the sprite you want to draw on.
Thanks. This seems to use repeated paste to "paint" a line on a sprite, true? Is there a more direct way, like pen down on [sprite], assuming coordinates etc. can be sorted out?
Use-case: I want each sprite's smile to broaden or shrink over time.
Also, I would like students to make compound expressions of my shape structs (just like they do with numbers & operators), and visualize the result value in the workspace (not stage) using a throw-away sprite
the only way to do that would be to record the starting pos, then move, then use the end pos, and then draw a line between those positions, but that would mean, place that script in every time you move. The only way I can think of making it efficient (and a lot less copy and paste code), would be to make custom blocks for the motion blocks which have the script in them. Not very ideal, but pretty much the only way you can do it.
Thanks, @dardoro. Good pointer, but (a) needs JS enabled, and (b) it does not appear to pick up drawn strokes unless the pen is down, which messes up the stage.
Any suggestions for (b)?
Any longer-term solution planned for (a)? I heard something in Snap!Con 21 that suggested it is being considered.
If you look in the second sprite, its doing that on purpose. You can just use the pen as normal when using the block. What it does is it creates a hidden clone that detects when the parent moves. When it does move, the clone will switch to the costume of the pen trails, and stamps it on the sprite. This has only one problem: If you set the sprite on an already painted pen trail, the pen trail will appear on the sprite, even though it hasn't been drawn on.