core-animation
Rust bindings for macOS Core Animation with ergonomic builder APIs.
Builders
| Builder | Purpose |
|---|---|
WindowBuilder |
Layer-backed windows with background, border, transparency |
CALayerBuilder |
Base layers with bounds, position, sublayers |
CAShapeLayerBuilder |
Vector shapes with path, fill, stroke, shadows |
CATextLayerBuilder |
Text rendering layers |
CAEmitterLayerBuilder |
Particle systems with closure-based cell configuration |
PointBurstBuilder |
Convenience API for radial particle bursts |
CABasicAnimationBuilder |
Standalone GPU-accelerated animations |
Quick Start
use *;
let window = new
.title
.size
.centered
.background_color
.build;
let circle = new
.circle
.position
.fill_color
.animate
.build;
window.container.add_sublayer;
window.show_for;
Animations
All layer builders support .animate() for GPU-accelerated animations:
.animate
Animatable properties: TransformScale, TransformRotation, Opacity, ShadowRadius, ShadowOpacity, Custom("propertyName")
Easing curves: Linear, In, Out, InOut
Particle Systems
use PI;
let emitter = new
.position
.shape
.particle
.build;
Or use the convenience builder:
let burst = new
.velocity
.color
.build;
Particle images: soft_glow, circle, star, spark
Examples
See examples/README.md for all examples with screenshots.
Platform
macOS only.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.