blockly > WorkspaceSvg > getTopBlocks

WorkspaceSvg.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): BlockSvg[];

Parameters

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

Returns:

BlockSvg[]

The top-level block objects.