Setup

Begin by cloning the Blockly repo and checking out the rendering-hackathon branch of Blockly. This contains some sample code to get us started.

git clone https://github.com/google/blockly
git checkout rendering-hackathon

Most of the changes we’ll be making will be in the core/renderers/minimalist directory. The minimalist renderer is the Blockly bare bones renderer with no specific changes added on to it.

  • In your choice of browser, open blockly/tests/playground.html
  • In your choice of code editor, open the blockly repo you checked out.

Changing Constants

Let’s start by adjusting some constants, and seeing the results in the playground.

Notches

In core/renderers/minimalist/constants.js, change the notch size. Here I’ve used a NOTCH_WIDTH of 20 and a NOTCH_HEIGHT of 10, but feel free to try out your own configuration.