路徑物件
PathObject
包含 DOM 中的 SVG 元素,構成區塊。
例如,在「Geras」轉譯器中,區塊具有「主要」路徑、「深色」路徑和「淺色」路徑,使其具有 3D 效果。路徑物件會為這些路徑建立 SVG 元素。

這與 Thrasos 轉譯器不同,其轉譯器有單一路徑元素和筆劃:

還能處理:
- 將導覽匣產生的形狀套用至 SVG 元素。
- 為 SVG 元素套用主題顏色。
- 將其他樣式套用至 SVG 元素。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-07-24 (世界標準時間)。
[null,null,["上次更新時間:2023-07-24 (世界標準時間)。"],[[["The `PathObject` manages the SVG elements that visually represent a block in Blockly, such as the main, dark, and light paths for 3D effects."],["It applies the shape created by the drawer, along with theme colors and other styling, to these SVG elements."],["Different renderers, like Geras and Thrasos, utilize `PathObject` to create unique visual styles for their blocks."]]],["The `PathObject` class manages the SVG elements that form a block's visual representation within the DOM. It generates SVG elements for different paths (e.g., main, dark, light) as seen in the Geras renderer or a single path as in the Thrasos renderer. It also applies the shape from the drawer, incorporates theme colors, and applies other styling to these SVG elements. It handles all these visual modifications of the block.\n"]]