Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > blockRendering > Panel > rysowanie
Metoda blockRendering.Drawer.draw()
Narysuj bryłę w obszarze roboczym. Tutaj „rysunek” oznacza ustawienie elementów ścieżki SVG oraz przenoszenie pól, ikon i połączeń na ekranie.
Elementy ścieżek są umieszczane w tablicach „kroków”, które są następnie łączone spacjami i ustawione bezpośrednio na bryle. Dzięki temu kroki będą rozdzielone spacjami, co zwiększy czytelność. Nie jest to jednak wymagane.
Podpis:
draw(): void;
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-29 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-29 UTC."],[[["The `blockRendering.Drawer.draw()` method visually renders a block on the workspace by manipulating SVG elements for its shape, fields, icons, and connections."],["This method achieves the visual representation by constructing SVG paths, dividing them into \"steps,\" and applying them directly to the block element for clear and readable rendering."],["The process focuses on updating the visual aspects of the block on the workspace without returning any specific value."]]],["The `draw()` method, part of the `blockRendering.Drawer` class, is responsible for rendering a block onto the workspace. This involves setting SVG path elements and positioning fields, icons, and connections. The method constructs the block's path by pushing path segments into \"steps\" arrays. These steps are then joined with spaces and assigned directly to the block. The method does not take any arguments and does not return anything.\n"]]