blockly > Workspace > newBlock

Méthode Workspace.newBlock()

Obtenez un bloc que vous venez de créer.

Signature :

newBlock(prototypeName: string, opt_id?: string): Block;

Paramètres

Paramètres Type Description
prototypeName chaîne Nom de l'objet de langage contenant des fonctions spécifiques au type pour ce bloc.
opt_id chaîne (Facultatif) Identifiant facultatif. Utilisez cet ID s'il est fourni. Sinon, créez-en un autre.

Renvoie :

Bloquer

Bloc créé.