調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
ブロックする >IConnectionChecker >canConnectWithReason
IConnectionChecker.canConnectWithReason() メソッド
現在の接続がターゲット接続に接続できるかどうかを確認し、問題がある場合はエラーコードを返します。
署名:
canConnectWithReason(a: Connection | null, b: Connection | null, isDragging: boolean, opt_distance?: number): number;
パラメータ
パラメータ |
型 |
説明 |
a |
つながり |null |
互換性を確認する接続。 |
b |
つながり |null |
互換性を確認する接続。 |
isDragging |
ブール値 |
ブロックをドラッグして接続している場合は true。 |
opt_distance |
数値 |
(省略可)ドラッグ チェックの接続間の最大許容距離。 |
戻り値:
数値
接続が正しい場合は Connection.CAN_CONNECT、それ以外の場合はエラーコード。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-08-21 UTC。
[null,null,["最終更新日 2024-08-21 UTC。"],[[["The `canConnectWithReason` method determines if two connections are compatible, returning `Connection.CAN_CONNECT` for valid connections or an error code otherwise."],["It considers the connections (`a`, `b`), if a block is being dragged (`isDragging`), and optionally, the maximum allowed distance (`opt_distance`)."],["The method is part of the `IConnectionChecker` interface, which helps manage connection rules in Blockly."]]],[]]