blockly > BlockSvg > przetłumacz
Metoda BlockSvg.translate()
Przekształca bryłę przez ustawienie translacji dla atrybutu „transform” pliku SVG bloku.
Podpis:
translate(x: number, y: number): void;
Parametry
Parametr |
Typ |
Opis |
x |
liczba |
Współrzędna X przesunięcia w jednostkach obszaru roboczego. |
y |
liczba |
Współrzędna Y przesunięcia w jednostkach obszaru roboczego. |
Zwroty:
nieważne
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-12 UTC.
[null,null,["Ostatnia aktualizacja: 2024-09-12 UTC."],[[["The `translate` method moves a block visually on the workspace by adjusting its x and y coordinates."],["This movement is achieved by directly manipulating the SVG transform attribute of the block."],["The method takes two arguments, `x` and `y`, representing the desired translation in workspace units."],["Calling `translate` does not return any value (void)."]]],[]]