blockly > Flyout > 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:數字;寬度:數字;} | 區塊的高度和寬度。 |
index | 號碼 | 這個矩形應放入墊子清單中的索引。 |
傳回:
SVGElement
為區塊後方的矩形新建 SVG 元素。