Snapblocks (Part 2)

Continuing the discussion from Snapblocks (Part 1) - #252 by sonic123cdmania.

Previous discussions:

Well, there's nothing I can do to help with that.

:-(. Sad

unless they decied to add it to forums sorry man

I just upgraded define blocks to make them easier to make.

{test {test} $turtle (wow) [cool] <nice> ((cool)) :: motion} :: define+

test ({} @addInput) @turtle () [] <> ()

snapblocks

Yeah, you can now use $ instead of @ for icons (both act the same, although I am thinking of allowing the $text-size-r-g-b to work for text with a $).

But, the icon list might be an oversight. There is a plain list icon, but also a list input.

I did not think about that, but I can add that in.

You guys asked for it, I added the ability to set block colors (and input colors) using rgb values instead of a hex code.

(color [rgb(0 , 255 , 255)] :: rgb(0,255,0))

snapblocks (2)

This really stemmed from me using the Color class from snap (more specifically morphic.js) in snapblocks, which has a function to get a color from an rgb() string (well, it was rgba(), but I modified it to allow rgb(). Should I see if jens wants that in morphic.js?).

edit: oops, somehow I broke something
edit2: now it's fixed

Alright guys, I feel like I'm getting close to the last thing I'm adding this release. Here's what I've currently added.

  • Boolean switches.

    • <t> <f> <true> <false>
      snapblocks (7)
  • Snap define blocks automatically replace different shaped inputs with upvars

    • {[string] (number) <boolean>} :: define+
      snapblocks (4)
  • Actually correct comments

    • snapblocks (5)
  • Set color using rgb values

    • (color [rgb(0 , 255 , 255)] :: rgb(0,255,0))
      snapblocks (8)
  • Add icons using $

    • $turtle
      snapblocks (9)

I do want to add the ability to change text color using $text-s-r-g-b before I release 1.4.0 though.

edit: I've got that working for the snap style, not the scratch styles yet.

Keep in mind, I have not released all this yet, I'm just putting all of this here so you guys can see what I've done. Plus, there's a lot more stuff that changed behind the scenes anyway.