You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I want to do : when user drag block(math_arithmetic) on canvas, it default has to 2 block(math_number) in the block(math_arithmetic) slots, not 2 empty slot.
Is it possible to do that ? can you give me some tip?
Thanks.
The text was updated successfully, but these errors were encountered:
This is a very good suggestion.
Google Blockly has this feature. I didn't move this to ublockly. But it can be done. I've checked the google's code. They append the default input into the block in the initialization phase. That is to build a block, we not only create the original block object, but also connect the default input block.
But in ublockly, we might have a simpler implementation. My thought is:
When we drag the block from the tool box into workspace, in addition to clone the original block object, we also check the input, create the input block and connect it to the parent block.
I will add this feature in the future. However, if you would like to have a try, PR is welcome:smile:
Hello:
I have some progress, similar your thought: drag the block to workspace, then check the input and create block and append,
but my codes is dirty for now ,I try to solve it.
Hello,
I want to do : when user drag block(math_arithmetic) on canvas, it default has to 2 block(math_number) in the block(math_arithmetic) slots, not 2 empty slot.
Is it possible to do that ? can you give me some tip?
Thanks.
The text was updated successfully, but these errors were encountered: