Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > IIcon > initView
Metoda IIcon.initView()
Tworzy elementy SVG dla ikony, która będzie umieszczona na bloku.
Podpis:
initView(pointerdownListener: (e: PointerEvent) => void): void;
Parametry
Parametr |
Typ |
Opis |
pointerdownListener |
(e: PointerEvent) => nieważne |
Detektor zdarzeń, który musi być dołączony do głównego elementu SVG za pomocą implementacji initView . Używany przez system gestów Blockly do prawidłowej obsługi kliknięć i przeciągnięć. |
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-08-22 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-22 UTC."],[[["The `initView` method is responsible for creating the SVG elements that visually represent the icon on a block."],["It takes a `pointerdownListener` function as an argument, which needs to be attached to the icon's root SVG element for proper click and drag handling."],["The method does not return any value (void)."]]],["The `initView` method, part of the `IIcon` interface, is responsible for generating the SVG elements of an icon on a block. It requires a `pointerdownListener` function as a parameter. This listener must be added to the root SVG element and is used by Blockly for click and drag event handling. The method returns no value.\n"]]