調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
ブロックする >グリッド >setSpacing
Grid.setSpacing() メソッド
グリッド線の中心間の間隔を設定します。
これを行っても、新しい間隔のグリッドへのスナップはトリガーされません。個々の最上位のブロックでトリガーする必要がある、ブロックをプログラムでグリッドにスナップする場合。グリッドへのスナップが有効になっている場合、次回ブロックをドラッグ&ドロップするとグリッドにスナップされます。
署名:
setSpacing(spacing: number): void;
パラメータ
戻り値:
void
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-08-21 UTC。
[null,null,["最終更新日 2024-08-21 UTC。"],[[["Sets the spacing between grid lines, without automatically snapping existing blocks."],["To snap blocks after changing spacing, it needs to be triggered individually or during the next drag-and-drop."],["The `setSpacing()` method takes one argument: `spacing`, a number representing the desired space between grid lines."]]],["The `Grid.setSpacing()` method adjusts the distance between grid line centers. It accepts a numerical `spacing` parameter. This action doesn't automatically snap existing blocks to the new grid; individual top-level blocks must trigger snapping separately. However, blocks dragged and dropped afterward will snap if grid snapping is active. The method returns nothing (void).\n"]]