Patternshop, a widget for many-layered drawing.
Patternshop’s been massively simplified to a single widget, inspired by Missooni, but the rest is left here for historical reasons.
%%WGT0{"w":[{"name":"patternshop1","type":"contraption","size":[512,342],"pos":[0,0],"show":"transparent","def":"patternshop","widgets":{"visible":{},"active":{}}}],"d":{"patternshop":{"name":"patternshop","size":[512,342],"margin":[0,0,0,0],"script":"on view do\n if !visible.locked\n me.show: \"transparent\"\n visible.show: \"transparent\"\n order: 1 drop keys deck.cards\n i: (first deck.cards).image\n if active.text\n n: (extract index where value = active.text from order)[0]\n else\n n: (extract index where value = me.parent.name from order)[0]\n end\n each c in n take order\n i: deck.cards[c].image.copy[].paste[i 0,0 1]\n end\n visible.paste[i]\n end \nend\n\non set_canvas x do\n visible.paste[x]\nend\n\non get_canvas do\n visible.copy[]\nend\n\non set_locked x do\n visible.locked: x\nend\n\non get_locked do\n visible.locked\nend\n\non set_clear x do\n visible.paste[image[card.parent.size]]\nend\n\non get_clear do\n visible.paste[image[card.parent.size]]\nend\n\non set_active x do\n active.text: x\nend\n\non get_active do\n active.text\nend","attributes":{"name":[],"label":[],"type":[]},"widgets":{"visible":{"type":"canvas","size":[512,342],"pos":[0,0],"show":"transparent","border":0,"scale":1},"active":{"type":"field","size":[100,20],"pos":[-32,-32],"locked":1,"show":"none","style":"plain"}}}}}
Usage:
- The first card is the first layer, no contraption needed
- Each additional card is a layer, add a Patternshop contraption to it
- Use the arrow keys to flip left and right between layers
- Use the regular Decker drawing tools to draw on a layer (turn them on in the Decker menu)
- Switch back to interact mode (pointer finger or the menu) to have the layers composed - you’ll have to do this when you switch to a layer. Missooni has it part of the layer selection to automatically do that in Patternshop Cinnanom.
This can be much more easily used standalone now as a contraption.
It has several properties for programming:
.canvas: get/set the image
.clear: clear the image
.locked: disable composition
And most importantly:
.active: sets the “active” card name. composites from the first up to but NOT including the active card. it assumes that you are drawing on active and thus don’t want it composed. setting it to nil automatically detects what card it is on.

