研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >网格 >setSpacing
Grid.setSpacing() 方法
设置网格线中心之间的间距。
这不会触发贴靠到新间隔的网格。如果您想以编程方式将块贴靠到网格,则需要在各个顶级块上触发。如果启用了对齐网格功能,则下次您拖放某个块时,它将贴靠网格。
Signature:
setSpacing(spacing: number): void;
参数
返回:
void
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["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"]]