Skip to main content
This reference guide is intended for developers and advanced users who want to understand the underlying data structure and supported features of the CAPlayground engine.

Supported Layer Types

Each layer in CAPlayground maps to an internal “Project Tag” used in the .tendies and .CA files, and corresponds to a native Apple Core Animation class (or a custom implementation).
TypeProject TagCore Animation ClassDescription
BasicbasicCALayerA standard rectangular layer with fill and border.
TexttextCATextLayerRenders text with custom fonts and alignment.
ImageimageCALayerDisplays static image assets via contents.
VideovideoCAKeyframeAnimationDisplays animated GIFs and MP4s via frame-based content swaps.
GradientgradientCAGradientLayerRenders axial, radial, or conic gradients.
EmitteremitterCAEmitterLayerHigh-performance particle system.
ReplicatorreplicatorCAReplicatorLayerDuplicates sublayers with cumulative offsets.
TransformtransformCATransformLayerA 3D container that preserves depth for its children.
Liquid GlassliquidGlassCALayer + FiltersSpecialized: Not a native CA class. It is a standard layer with specialized background filters and distortion maps.

Core Layer Properties

These properties are common to almost all layer types (LayerBase).
PropertyKeyPathTypeAnimatable
Position Xposition.xnumberYes
Position Yposition.ynumberYes
Z PositionzPositionnumberYes
Widthbounds.size.widthnumberYes
Heightbounds.size.heightnumberYes
Opacityopacitynumber (0-1)Yes
Rotation Ztransform.rotation.znumber (deg)Yes
Rotation Xtransform.rotation.xnumber (deg)Yes
Rotation Ytransform.rotation.ynumber (deg)Yes
Corner RadiuscornerRadiusnumberYes
Background ColorbackgroundColorhex stringNo
Border WidthborderWidthnumberNo
Border ColorborderColorhex stringNo

Supported Filters

Filters are applied via the Filters tab. All filter values are animatable.
Filter NameInternal TypeValue LabelRange/Unit
Gaussian BlurgaussianBlurRadiusPixels
ContrastcolorContrastAmountMultiplier (1.0 = Default)
Hue RotatecolorHueRotateAngleDegrees
SaturatecolorSaturateAmountMultiplier (1.0 = Default)
SepiaCISepiaToneIntensity0.0 to 1.0
InvertcolorInvert(None)Toggle

State Transition Properties

The following properties can be modified between states (e.g., Locked -> Unlock). When a state changes, these properties will animate smoothly.
  • position.x / position.y
  • zPosition
  • bounds.size.width / bounds.size.height
  • transform.rotation.z / transform.rotation.x / transform.rotation.y
  • opacity
  • cornerRadius
  • borderWidth / borderColor
  • backgroundColor
  • fontSize / color (Text Layers only)

Gyro Tilt KeyPaths

When configuring Gyro Dictionaries on a Transform Layer, you can map device tilt to the following properties:
KeyPathEffect
position.x / position.ySlides the layer horizontally or vertically.
transform.translation.x / ySimilar to position, but relative to the layer’s local space.
transform.rotation.xTilts the layer forward or backward (3D).
transform.rotation.yTilts the layer left or right (3D).
transform.rotation.zRotates the layer clockwise or counter-clockwise.
opacityFades the layer in/out based on tilt.

Advanced Layer Properties

Video Layer (video)

  • frameCount: Total number of frames in the sequence.
  • fps: playback speed (default: 30).
  • autoReverses: When true, plays forward then backward.
  • calculationMode: linear (blended) or discrete (stepped).
  • syncWWithState: Enables frame-sync with state transitions (Locked/Unlock).

Emitter Layer (emitter)

Particles are defined in emitterCells (CAEmitterCell[]). Key properties per cell:
  • birthRate: Particles per second.
  • lifetime: Duration of each particle.
  • velocity: Movement speed.
  • emissionRange: Spread angle (radians).
  • scale / scaleSpeed: Initial size and growth/shrink rate.
  • alphaSpeed: Fade rate over time.

Naming Conventions & IDs

  • Layer IDs: Must be unique within the project. The editor typically generates UUIDs.
  • Asset Paths: Relative paths (e.g., assets/image.png).
  • State Names: The default states are Base State, Locked, Unlock, and Sleep.
Note on Coordinates: CAPlayground uses a normalized coordinate system for some properties (like anchorPoint 0.0 to 1.0) and pixel-based coordinates for position and size.