Skip to main content

Home > blockly > Block > moveBy

Block.moveBy() method

Move a block by a relative offset.

Signature:

moveBy(dx: number, dy: number, reason?: string[]): void;

Parameters

ParameterTypeDescription
dxnumberHorizontal offset, in workspace units.
dynumberVertical offset, in workspace units.
reasonstring[](Optional) Why is this move happening? 'drag', 'bump', 'snap', ...

Returns:

void