JS-less way to get a costume from a Snap symbol?

So we all know our beloved symbols in Snap. Like the ($flag--0-255-0 flag :: other), or the ($robot robot :: other).

I want to get a costume from a Snap*!* icon. Something like this:

(get costume from symbol \$[[magnifierOutline] v] scale (1) :: looks)

Is this possible without JS?

Probably the only way is to use the 1000452464 block in the (EDC) script pic costumes library, although you would have to figure out how to get rid of the block background.

Also the drop-shadow too...

Well, you could switch to flat design, or just remove the drop-shadow color.

If I turn on flat design, and put the block in a custom category colored white, I get this.

And you can get rid of the white background like this

You can probably do the same thing for the outline, I just don't have the color for the outline.

There's probably also a faster way with hyperblocks, I just don't know what it is.

How would hyperblocks help?

Also I think we can get the robo by upscaling him something like 10x ($robot-10)

untitled script pic (11)
Why is my code so laggy? Did I mess up?

Also, how did you turn the symbols to SVG? I might be able to take some of those precious SVG paths for my own projects... (crediting you for the sourcing)

I went to the snap source code and basically just converted the canvas drawing commands to svg path commands (although some I could replicate with just regular svg elements, rather than a path, for example, $square can just be done using a <rect> element). You can view all the snapblocks icons here.

Yeah, I know the symbols are drawn using a canvas. I'm started thinking of a "Bad Editor" idea where it's Bad Apple ran in the editor with the help of one tiny big symbol, but this is unrelated to my question.

If the icon (exclude bg) is all one color, can you just filter by the color?

Yeah, although apparently there is some variation for some reason.

1000452468

Although you could do some more stuff to get it right.

a BlockSymbolMorph: "robot" [372@399 | 13@13]

here you go :D

You could use XML editing to make a transparent block and use Flat design to remove the shadow.

Edit: I just realized that transparent categories don't work in Flat design, so set Fade blocks to 100.
Edit 2: That just makes it have a white background. I don't think it's possible to automate without keeping some junk pixels.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.