question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable hats per block

See original GitHub issue

Each block should be able to define its own “hat”, independent of others. It is currently a global setting defined via Blockly.BlockSvg.START_HAT.

JSON

The JSON syntax for this should live under a "style" property.

eg.

{
  "name": "some_block",
  "style": {
    "hat": "cap"
  }
  ...
}

Two values can be specified for "hat":

  1. "none" - Flat horizontal top screen shot 2017-09-18 at 2 19 53 pm

  2. "cap" - Rounded oval with horizontal base unnamed

Defining a hat in JSON still follows current rules, where it’s only rendered if the block doesn’t have a previous or output connection.

JavaScript

A hat property needs to be added to the Block object.

Additionally, a new JS property should be defined named Blockly.BlockSvg.Style.HAT (note the added Style part). This new property accepts the same string values (“none” or “cap”) and is the default hat to use for all blocks without a previous or output connection. This should deprecate Blockly.BlockSvg.START_HAT.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vicngcommented, Sep 18, 2017

Yes, “true”/“false” doesn’t make sense if multiple hat types can be defined. We can still support it, but it should be removed from documentation.

0reactions
alschmiedtcommented, Oct 7, 2019

A user can create a block style with “hat” and then set that block style for their specific block. More information can be found here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I enable hats on an FTB Infinity Evolved Server?
There is a mod called Hats. If the mod file is in both the client and the server 'mods' folders, Hats will be...
Read more >
Spotlight: Minecraft Hats Mod - YouTube
But you know what we're still missing? HATS ! For show notes, includ... ... Spotlight: Minecraft Hats Mod ... Block Facts New 326K...
Read more >
Working with screen events - IBM
A screen combination is a HATS screen event designed to gather output data from consecutive, similar host screens, combine it, and display it...
Read more >
Start Hat in Jan 2020 release - Google Groups
I am using Zelos, and before this release I could turn on start hats by setting. Blockly.BlockSvg.START_HAT = true. In the new release...
Read more >
Custom hat block - Snap! Feature Requests
Oh, Brian, the custom hat block is don't a "forever if" loop with a hat!!! ... until when is false until when is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found