Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
blockly > Blockieren > (Konstrukteur)
Block.(constructor)
Erstellt eine neue Instanz der Block
-Klasse
Unterschrift:
constructor(workspace: Workspace, prototypeName: string, opt_id?: string);
Parameter
Parameter |
Typ |
Beschreibung |
Arbeitsbereich |
Workspace |
Arbeitsbereich des Blocks. |
prototypeName |
String |
Name des Sprachobjekts, das typspezifische Funktionen für diesen Block enthält. |
opt_id |
String |
(Optional) Optionale ID. Verwenden Sie diese ID, falls vorhanden. Andernfalls erstellen Sie eine neue ID. |
Ausnahmen
Wenn der „PrototypeName“-Wert ungültig oder nicht zulässig ist.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-25 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[],["The `Block` class constructor creates a new block instance within a specified `Workspace`. It requires the `Workspace` object and a `prototypeName` (a string identifying the block's type-specific functions). An optional string `opt_id` can be provided to assign a specific ID to the block; otherwise, a new ID will be generated. The constructor throws an exception if the `prototypeName` is invalid.\n"]]