blockly > RenderedConnection > setOffsetInBlock
RenderedConnection.setOffsetInBlock() method
Set the offset of this connection relative to the top left of its block.
Signature:
setOffsetInBlock(x: number, y: number): void;
Parameters
Parameter |
Type |
Description |
x |
number |
The new relative x, in workspace units. |
y |
number |
The new relative y, in workspace units. |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `setOffsetInBlock()` method positions a connection point within its parent block using x and y coordinates."],["This method is part of the `RenderedConnection` class and updates the connection's location relative to the block's top-left corner."],["`x` and `y` input parameters represent the horizontal and vertical offsets, respectively, measured in workspace units."]]],["The `setOffsetInBlock` method, part of the `RenderedConnection` class, adjusts a connection's position within its block. It takes two parameters: `x` and `y`, both numbers representing the new horizontal and vertical offsets, respectively, in workspace units. This method's purpose is to reposition the connection, relative to the top-left corner of its containing block, with the function returning void.\n"]]