Stay organized with collections Save and categorize content based on your preferences.

blockly > Block > (constructor)

Block.(constructor)

Constructs a new instance of the Block class

Signature:

constructor(workspace: Workspace, prototypeName: string, opt_id?: string);

Parameters

Parameter Type Description
workspace Workspace The block's workspace.
prototypeName string Name of the language object containing type-specific functions for this block.
opt_id string (Optional) Optional ID. Use this ID if provided, otherwise create a new ID.

Exceptions

When the prototypeName is not valid or not allowed.