Stay organized with collections
Save and categorize content based on your preferences.
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `highlightBlock` method is used to visually distinguish a specific block or unhighlight all blocks within the workspace."],["It takes an optional `opt_state` parameter that allows for manual control over highlighting, otherwise it automatically unhighlights other blocks when highlighting a new one."],["The primary use case for this method is to visually indicate the block currently being executed."]]],[]]