figureone
    Preparing search index...

    FigureElementCollection options object.

    A collection is a group of other FigureElements that will all inherit the parent collections transform.

    • transform TypeParsableTransform
    • position TypeParsablePoint — if defined, will overwrite first translation of transform
    • color TypeColor — default color
    • parent FigureElement | null — parent of collection
    • border rect | TypeParsableBuffer | TypeParsableBorder | children — defines border of collection. Use children to use the borders of the children. Use 'rect' for the bounding rectangle of the borders of the children. Use TypeParsableBuffer for the bounding rectangle of the borders of the children with some buffer. Use TypeParsableBorder for a custom border. ('children')
    • touchBorder rect | TypeParsableBuffer | TypeParsableBorder | children | border — defines the touch border of the collection. Use 'border' to use the same as the border of the collection. Use children to use the touch borders of the children. Use 'rect' for the bounding rectangle of the touch borders of the children. Use TypeParsableBuffer for the bounding rectangle of the touch borders of the children with some buffer. Use TypeParsableBorder for a custom touch border. ('children')
    figure.add(
    {
    name: 'c',
    make: 'collection',
    elements: [ // add two elements to the collection
    {
    name: 'hex',
    make: 'polygon',
    sides: 6,
    radius: 0.5,
    },
    {
    name: 'text',
    make: 'text',
    text: 'hexagon',
    position: [0, -0.8],
    xAlign: 'center',
    font: { size: 0.3 },
    },
    ],
    },
    );

    // When a collection rotates, then so does all its elements
    figure.getElement('c').animations.new()
    .rotation({ target: Math.PI * 1.999, direction: 1, duration: 5 })
    .start();
    // Collections and primitives can also be created from `figure.collections`
    // and `figure.primitives`.
    const c = figure.collections.collection();
    const hex = figure.primitives.polygon({
    sides: 6,
    radius: 0.5,
    });
    const text = figure.primitives.text({
    text: 'hexagon',
    position: [0, -0.8],
    xAlign: 'center',
    font: { size: 0.3 },
    });
    c.add('hex', hex);
    c.add('text', text);
    figure.add('c', c);

    // When a collection rotates, then so does all its elements
    c.animations.new()
    .delay(1)
    .rotation({ target: Math.PI * 1.999, direction: 1, duration: 5 })
    .start();
    @interface