blockly > WorkspaceSvg > highlightBlock

WorkspaceSvg.highlightBlock() method

Highlight or unhighlight a block in the workspace. Block highlighting is often used to visually mark blocks currently being executed.

Signature:

highlightBlock(id: string | null, opt_state?: boolean): void;

Parameters

Parameter Type Description
id string | null ID of block to highlight/unhighlight, or null for no block (used to unhighlight all blocks).
opt_state boolean (Optional) If undefined, highlight specified block and automatically unhighlight all others. If true or false, manually highlight/unhighlight the specified block.

Returns:

void