Skip to main content

Home > blockly > BlockSvg > translate

BlockSvg.translate() method

Transforms a block by setting the translation on the transform attribute of the block's SVG.

Signature:

translate(x: number, y: number): void;

Parameters

ParameterTypeDescription
xnumberThe x coordinate of the translation in workspace units.
ynumberThe y coordinate of the translation in workspace units.

Returns:

void