Mutators from WorkSpace Factory

79 views
Skip to first unread message

Burak Bilgehan

unread,
Dec 20, 2016, 9:39:41 AM12/20/16
to Blockly


Hello, I want to create a custom block just like the "if else" block from workspace factory. I want to analyze it's structure like this:


But I can't open the if else block from this window. How can I view its structure, so that I can modify it to create my own block. I found it too complex to code it with JavaScript, so that's why I'm asking.
Thanks

picklesrus

unread,
Dec 21, 2016, 2:18:07 PM12/21/16
to Blockly
Unfortunately we haven't built support for mutators into the block factory at this point.

How would you like to modify the current if/else block? Do you want it to have a mutator? Perhaps we can help you figure out which pieces to modify in the javascript.

Burak Bilgehan

unread,
Dec 26, 2016, 9:06:03 AM12/26/16
to Blockly
Hello thanks for the reply, and sorry for the delay. Because of other projects I couldn't find the time to reply.

Let's say we have a function called filter. It contains 2 sub-blocks.
* First sub-block is for filtering the given input by comparison (checks equality, inequality, gteq, lteq etc.)
* Second sub-block is for filtering the items of the given input with an upper and a lower bound.

Now let's call the first one as a, and the second one as b.
Our blocks should be something like this:
Filter:
  *a;
  *a;
  *b;
  *a;

Each of these a's are different filtering conditions like. The user can make a narrow filter by adding different specialities. We want to add those a's and b's like adding "else if" and "else" sub-blocks to the "if" block. But of course there are differences. For example, unlike "if" block, we can add as much as sub blocks we want to.
Mutator codes are too long and since I'm not too familiar with javascript, most of the code doesn't make sense to me. So that's why we struggled implementing mutators.


Reply all
Reply to author
Forward
0 new messages