Renderowanie informacji
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wartość RenderInfo
określa sposób rozmieszczania elementów wizualnych bloku.
Blok jest zawsze tworzony z danych wejściowych, połączeń i pól, ale można go rozmieścić na wiele różnych sposobów. Na przykład ta sama definicja bloku może być renderowana za pomocą wbudowanych lub zewnętrznych danych wejściowych.

Informacje o renderowaniu określają, który układ zostanie wybrany.
Pierwszym krokiem w renderowaniu jest sprawdzenie definicji bloku oraz wymiarów jego elementów wizualnych. Następnie decyduje, jak powinien wyglądać blok, i odpowiednio porządkuje informacje. Informacje są przekształcane w nienachodzące na siebie elementy i przestrzenie między nimi, które są uporządkowane w nienachodzące na siebie wiersze i przestrzenie między wierszami.
Następnie drawer używa uporządkowanych informacji o układzie do utworzenia ścieżek SVG reprezentujących blok.
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: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eRenderInfo\u003c/code\u003e dictates the visual layout of a block's elements, such as inputs, connections, and fields, determining aspects like inline or external input placement.\u003c/p\u003e\n"],["\u003cp\u003eIt analyzes the block definition and element measurements to establish an optimal layout, organizing the information into elements, spacers, rows, and row spacers for a non-overlapping visual structure.\u003c/p\u003e\n"],["\u003cp\u003eThis organized layout information is then utilized by the drawer to generate the final SVG paths that visually represent the block.\u003c/p\u003e\n"]]],["`RenderInfo` defines a block's visual layout. It analyzes a block's inputs, connections, and fields, considering external or inline input options. It determines the layout, organizing visual components into non-overlapping elements, spacers, rows, and row spacers. This structured information is then passed to the drawer, which generates the SVG paths for the block's visual representation. The core task of the render info is to take visual elements and organize them.\n"],null,["# Render info\n\nThe [`RenderInfo`](/blockly/reference/js/blockly.blockrendering_namespace.renderinfo_class) determines how a block's visual elements get\nlaid out.\n\nA block is always built out of inputs, connections, and fields, but those\ncan be laid out in many different ways. For example, the same block definition\ncan be rendered with [inline inputs or external inputs](/blockly/guides/create-custom-blocks/define/inline-vs-external).\n\nThe render info determines which layout is chosen.\n\nAs the first step of rendering, the render info looks at the block's definition,\nand the measurements of its visual pieces. Then it decides how the block should\nbe laid out, and organizes the information accordingly. The information gets\nturned into non-overlapping [elements](/blockly/guides/create-custom-blocks/renderers/concepts/elements) and [spacers](/blockly/guides/create-custom-blocks/renderers/concepts/elements#element_spacer),\nwhich are organized into non-overlapping [rows](/blockly/guides/create-custom-blocks/renderers/concepts/rows), and\n[row spacers](/blockly/guides/create-custom-blocks/renderers/concepts/rows#row_spacer).\n\nThen the [drawer](/blockly/guides/create-custom-blocks/renderers/concepts/drawer) uses that organized layout information to create the\nSVG paths representing the block."]]