Close

I stand heavily corrected on block reshaping

A project log for Barnabas Blocks Upgrade - BIG 2021

Webserial API webtool to upload Arduino code.

danteDante 07/26/2021 at 20:471 Comment

It appears Blockly has some built-in customization for block shapes. This is used when initializing the Blockly workspace in code.js:1094 - 

Blockly.Themes.Barnabas = Blockly.Theme.defineTheme('barnabas', {
  'base': Blockly.Themes.Classic,
  'componentStyles': componentStyles,
  'blockStyles': blockStyles,
  'categoryStyles': categoryStyles,
  'fontStyle': fontStyle,
  'startHats': true
});

Hats are the arc shape on top of event blocks. There are only two event blocks in Barnabas Blocks - the setup/loop block and the subroutine declaration block. If startHats is set falsey, then these arcs will not be drawn:

Therefore there is at least one method to reshape blocks through the regular Blockly API. My endless searching through projects was therefore unfortunately not very useful.

Hopefully I can find more ways, but in the meantime I'll be reversing the gulp toolchain responsible for the compressed source files (mainly the Blockly ones) so that editing is actually practical.

Discussions

Edward Li wrote 07/27/2021 at 05:39 point

Nice!  Good find!

  Are you sure? yes | no