Encuesta de investigación: Cuéntanos sobre tu experiencia con Blockly
Comenzar encuesta
blockly > Flotante > createRect_
Método Flyout.createRect_()
Crea y coloca un rectángulo correspondiente al bloque determinado.
Signature:
protected createRect_(block: BlockSvg, x: number, y: number, blockHW: {
height: number;
width: number;
}, index: number): SVGElement;
Parámetros
Parámetro |
Tipo |
Descripción |
bloquear |
BlockSvg |
El bloque al que se asociará el rectángulo. |
x |
número |
La posición x del cursor durante este pase de diseño. |
y |
número |
La posición y del cursor durante este pase de diseño. |
blockHW |
{ height: number; ancho: número; }. |
La altura y el ancho del bloque. |
index |
número |
Es el índice en la lista de colchonetas donde se debe colocar este rectángulo. |
Muestra:
SVGElement
Elemento SVG recién creado para el rectángulo detrás del bloque.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2024-09-12 (UTC)
[null,null,["Última actualización: 2024-09-12 (UTC)"],[[["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"]]