Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > utils > Współrzędne > przetłumacz
Metoda utils.Coordinate.translate()
Tłumaczy tę współrzędną według podanych przesunięcia. .
Podpis:
translate(tx: number, ty: number): Coordinate;
Parametry
Parametr |
Typ |
Opis |
TX |
liczba |
Wartość, według której ma zostać przetłumaczona wartość x. |
Ty |
liczba |
Wartość, według której następuje przesunięcie względem osi y. |
Zwroty:
Współrzędne
Ta koordynacja po przetłumaczeniu.
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-08-21 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2024-08-21 UTC."],[[["The `utils.Coordinate.translate()` method modifies a coordinate by adding specified horizontal (tx) and vertical (ty) offsets."],["This method accepts two numeric arguments: `tx` for horizontal translation and `ty` for vertical translation."],["It returns the updated `Coordinate` object after applying the translations."]]],["The `translate()` method within the `Coordinate` class shifts a coordinate's position. It accepts two numerical parameters: `tx` and `ty`. `tx` determines the horizontal shift, while `ty` dictates the vertical shift. The method then returns a new `Coordinate` object reflecting the translated position. This effectively modifies the coordinate by the specified x and y offsets.\n"]]