Scratch-blocks: Creating block with neither previousStatement nor nextStatement results in incorrectly displayed block icon.

Created on 19 Oct 2016  路  7Comments  路  Source: LLK/scratch-blocks

I'm creating a starting block that has neither a previousStatement nor a nextStatement, since all blocks are to be placed as an input.

init: function() {
      this.jsonInit({
        "id": "[ID]",
        "message0": "%1 %2",
        "args0": [
          {
            "type": "input_statement",
            "name": "SUBSTACK"
          },
          {
            "type": "field_image",
            "src": Blockly.mainWorkspace.options.pathToMedia + "icons/turtle/snow.svg",
            "width": 40,
            "height": 40,
            "flip_rtl": false
          }
        ],
        "inputsInline": true,
        "category": Blockly.Categories.turtle,
        "colour": Blockly.Colours.control.primary,
        "colourSecondary": Blockly.Colours.control.secondary,
        "colourTertiary": Blockly.Colours.control.tertiary
      });
    }

It looks something like this:
image
Notice that the icon isn't correctly placed on the block.

If I add a line "previousStatement":null, to the json, then the block looks like this:
image
Notice that the icon is correctly placed on the block.

bug

Most helpful comment

Will extension blocks be supported in the horizontal layout? If so, this seems like a necessary feature.

All 7 comments

Hi @madCode:

We're not actively supporting horizontal block configurations beyond our designed set. Properly supporting all possible horizontal block configurations would require a bunch of design work (e.g., what if you have more than one value input - where does it go?)

If you need the flexibility to do this sort of thing, I suggest using the vertical blocks - they're fully equipped for that!

Will extension blocks be supported in the horizontal layout? If so, this seems like a necessary feature.

Just a note, I think this is just a layout bug as the block does fit in the set of Horizontal block features that have been designed.

@PullJosh But why would you want a hat-cap block?

@PullJosh But why would you want a hat-cap block?

If I'm being honest, I hadn't really gotten that far in my thinking. :P

@PullJosh But why would you want a hat-cap block?

If I'm being honest, I hadn't really gotten that far in my thinking. :P

SCRATCH 3 WEB-BLOX

After design discussion I believe we've decided not to support this type of behavior in horizontal blocks in the near future.

Was this page helpful?
0 / 5 - 0 ratings