Node / Images Shapes · guide
Grouped layers (isGrouped, groupTransform)
Current Apexify.js 6.0.0 documentation for Grouped layers (isGrouped, groupTransform).
Pass CreateImageOptions as the third argument to createImage when you want multiple ImageProperties entries composited as one logical layer.
Activation rules
SOURCEtypescript
typescript
Requirements:
imagesmust be an array with more than one entry.options.isGroupedmust betrueand you supplygroupTransform— otherwisepaintImageLayersOntoContextfalls back to drawing items sequentially like unrelated layers.
What groupTransform can do
Mirrors many ImageProperties fields:
| Area | Supported keys |
|---|---|
| Motion | rotation, translateX, translateY, scaleX, scaleY, pivotX, pivotY |
| Layer style | opacity, blur, blendMode |
| Clip / plate | borderRadius, borderPosition, clipPath, boxBackground |
| Typed, not wired on group | mask, distortion, meshWarp on groupTransform exist in TS but the renderer ignores them — assign on each ImageProperties instead. |
Implementation notes worth remembering:
filterOrder: 'pre'composites every child bitmap into an off-screen buffer clipped to the axis-aligned group bounding box, filters once, then blits — per-layer rotations are stripped (rotation: 0clone). Earlyreturnskips transforms/effects/stroke pipeline besides what that branch draws.filterOrder: 'post'(default behaviour when unset or non-pre) rasterises transformed corners into a tighter rectangle estimate before filtering — heavily rotated groups might crop imperfectly near edges.- Per-layer
rotationvalues are intentionally forced to0inside the grouped loop — rotate withgroupTransform.rotationinstead.
Stroke after grouping
After transforms restore, groupTransform.stroke outlines the original axis-aligned union rectangle (groupBox) optionally re-applying rotation/scale translation — handy for framing stickers.
When not to group
- You need independent
effectstimings per bitmap with precisestrokeordering alongsidemeshWarp— split layers instead. - Only one image is present —
isGroupedadds no benefit.
Related reading
- Paint order — contrasts grouped vs solo pipelines.