blockly > Workspace > getTopBlocks

Workspace.getTopBlocks() method

Finds the top-level blocks and returns them. Blocks are optionally sorted by position; top to bottom (with slight LTR or RTL bias).

Signature:

getTopBlocks(ordered?: boolean): Block[];

Parameters

Parameter Type Description
ordered boolean (Optional) Sort the list if true.

Returns:

Block[]

The top-level block objects.