轉譯資訊
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
RenderInfo
會決定區塊的視覺元素如何排版。
區塊一律由輸入、連結和欄位建構而成,但這些元素可以以多種方式排版。舉例來說,同一個區塊定義可以使用內嵌輸入或外部輸入進行轉譯。

算繪資訊會決定要選擇哪種版面配置。
算繪資訊是算繪的第一步,會查看區塊的定義,以及其視覺部分的尺寸。接著,系統會決定區塊的版面配置方式,並據此整理資訊。系統會將資訊轉換為不重疊的元素和間距,並將這些元素和列間距排列成不重疊的列。
接著,抽屜會使用該有條理的版面配置資訊,建立代表區塊的 SVG 路徑。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\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."]]