Apply entrance, exit, and loop animations to design blocks using the available animation types in CE.SDK.

CE.SDK organizes animations into three categories: entrance (In), exit (Out), and loop. Each category determines when the animation plays during the block’s lifecycle. This guide demonstrates different animation types and their configurable properties.
This guide covers applying entrance animations (slide, fade, zoom), exit animations, loop animations, and configuring animation properties like direction, easing, and intensity.
Entrance Animations#
Entrance animations define how a block appears. We use createAnimation() with the animation type and attach it using setInAnimation().
Slide Animation#
The slide animation moves a block in from a specified direction. The direction property uses radians where 0 is right, π/2 is bottom, π is left, and 3π/2 is top.
// Create a slide animation that enters from the leftconst slideAnimation = engine.block.createAnimation('slide');engine.block.setInAnimation(block1, slideAnimation);engine.block.setDuration(slideAnimation, 1.0);// Direction in radians: 0=right, PI/2=bottom, PI=left, 3*PI/2=topengine.block.setFloat(slideAnimation, 'animation/slide/direction', Math.PI);engine.block.setEnum(slideAnimation, 'animationEasing', 'EaseOut');Fade Animation#
The fade animation transitions opacity from invisible to fully visible. Easing controls the animation curve.
// Create a fade entrance animationconst fadeAnimation = engine.block.createAnimation('fade');engine.block.setInAnimation(block2, fadeAnimation);engine.block.setDuration(fadeAnimation, 1.0);engine.block.setEnum(fadeAnimation, 'animationEasing', 'EaseInOut');Zoom Animation#
The zoom animation scales the block from a smaller size to its final dimensions. The fade property adds an opacity transition during scaling.
// Create a zoom animation with fade effectconst zoomAnimation = engine.block.createAnimation('zoom');engine.block.setInAnimation(block3, zoomAnimation);engine.block.setDuration(zoomAnimation, 1.0);engine.block.setBool(zoomAnimation, 'animation/zoom/fade', true);Other entrance animation types include:
blur— Transitions from blurred to clearwipe— Reveals with a directional wipepop— Bouncy scale effectspin— Rotates the block into viewgrow— Scales up from a point
Exit Animations#
Exit animations define how a block leaves the screen. We use setOutAnimation() to attach them. CE.SDK prevents overlap between entrance and exit durations automatically.
// Create entrance and exit animationsconst wipeIn = engine.block.createAnimation('wipe');engine.block.setInAnimation(block4, wipeIn);engine.block.setDuration(wipeIn, 1.0);engine.block.setEnum(wipeIn, 'animation/wipe/direction', 'Right');
// Exit animation plays before block disappearsconst fadeOut = engine.block.createAnimation('fade');engine.block.setOutAnimation(block4, fadeOut);engine.block.setDuration(fadeOut, 1.0);engine.block.setEnum(fadeOut, 'animationEasing', 'EaseIn');In this example, a wipe entrance transitions to a fade exit. Mirror entrance effects for visual consistency, or use contrasting effects for emphasis.
Loop Animations#
Loop animations run continuously while the block is visible. They can combine with entrance and exit animations. We use setLoopAnimation() to attach them.
// Create a breathing loop animationconst breathingLoop = engine.block.createAnimation('breathing_loop');engine.block.setLoopAnimation(block5, breathingLoop);engine.block.setDuration(breathingLoop, 2.0);// Intensity: 0 = 1.25x max scale, 1 = 2.5x max scaleengine.block.setFloat( breathingLoop, 'animation/breathing_loop/intensity', 0.3);The duration controls each cycle length. Loop animation types include:
breathing_loop— Slow scale pulsepulsating_loop— Rhythmic scalespin_loop— Continuous rotationfade_loop— Opacity cyclingsway_loop— Rotational oscillationjump_loop— Jumping motionblur_loop— Blur cyclingsqueeze_loop— Squeezing effect
Combined Animations#
A single block can have entrance, exit, and loop animations running together. The loop animation runs throughout the block’s visibility while entrance and exit animations play at the appropriate times.
// Apply entrance, exit, and loop animations togetherconst spinIn = engine.block.createAnimation('spin');engine.block.setInAnimation(block6, spinIn);engine.block.setDuration(spinIn, 1.0);engine.block.setEnum(spinIn, 'animation/spin/direction', 'Clockwise');engine.block.setFloat(spinIn, 'animation/spin/intensity', 0.5);
const blurOut = engine.block.createAnimation('blur');engine.block.setOutAnimation(block6, blurOut);engine.block.setDuration(blurOut, 1.0);
const swayLoop = engine.block.createAnimation('sway_loop');engine.block.setLoopAnimation(block6, swayLoop);engine.block.setDuration(swayLoop, 1.5);Configuring Animation Properties#
Each animation type has specific configurable properties. We use findAllProperties() to discover available properties and getEnumValues() to query options for enum properties.
// Discover available properties for any animationconst properties = engine.block.findAllProperties(slideAnimation);console.log('Slide animation properties:', properties);
// Query available easing optionsconst easingOptions = engine.block.getEnumValues('animationEasing');console.log('Available easing options:', easingOptions);Common configurable properties include:
- Direction: Controls entry/exit direction in radians or enum values
- Easing: Animation curve (
Linear,EaseIn,EaseOut,EaseInOut) - Intensity: Strength of the effect (varies by animation type)
- Fade: Whether to include opacity transition
API Reference#
| Method | Description |
|---|---|
engine.block.createAnimation(type) | Create animation by type string |
engine.block.setInAnimation(block, anim) | Attach entrance animation |
engine.block.setOutAnimation(block, anim) | Attach exit animation |
engine.block.setLoopAnimation(block, anim) | Attach loop animation |
engine.block.setDuration(anim, seconds) | Set animation duration |
engine.block.setFloat(anim, property, value) | Set numeric property |
engine.block.setEnum(anim, property, value) | Set enum property |
engine.block.setBool(anim, property, value) | Set boolean property |
engine.block.findAllProperties(anim) | Discover configurable properties |
engine.block.getEnumValues(property) | Get available enum values |
Next Steps#
- Base Animations — Create and attach animations to blocks
- Text Animations — Animate text with writing styles
- Animation Overview — Animation concepts and capabilities