封鎖 >飛出 >createRect_
Flyout.createRect_() 方法
建立並放置與指定區塊對應的矩形。
Signature:
protected createRect_(block: BlockSvg, x: number, y: number, blockHW: {
height: number;
width: number;
}, index: number): SVGElement;
參數
參數 |
類型 |
說明 |
封鎖 |
BlockSvg |
要與矩形建立關聯的方塊。 |
x |
數字 |
在此版面配置傳遞期間,遊標的 x 位置。 |
y |
數字 |
在此版面配置傳遞期間,遊標的 y 位置。 |
blockHW |
{ height: number;width: 數字;} |
區塊的高度和寬度。 |
索引 |
數字 |
應放置這個矩形的 mats 清單索引。 |
傳回:
SVGElement
為區塊後方矩形新增的 SVG 元素。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-12 (世界標準時間)。
[null,null,["上次更新時間:2024-09-12 (世界標準時間)。"],[[["The `Flyout.createRect_` method generates an SVG rectangle element positioned behind a given block within the flyout."],["This method utilizes the block's dimensions and position to create the rectangle, associating it with the block for visual representation."],["The created rectangle is then inserted into the flyout's layout structure, contributing to the overall organization of blocks."]]],["The `createRect_` method creates a rectangle associated with a given block. It takes a `BlockSvg` object, x and y coordinates for positioning, the block's height and width, and an index for placement in a list. This method then generates and returns a new SVG element representing the rectangle positioned behind the specified block. It uses parameters to define the block to be associated to, its coordinates and size, and index placement.\n"]]