Logic
Custom JavaScript effects that run inside the file.
Updated November 2026
Effect scripts let you write JavaScript that draws a layer every frame. You export a params object, which becomes sliders and colour pickers in the inspector, and a render(ctx, env) function that draws with the canvas API. The script can read time, size, the pointer and state machine inputs, and set inputs back.
Free Community plan · Browser, macOS and Windows
- Language
- JavaScript
- Draws with
- Canvas 2D (and GLSL)
- Params
- Become inspector controls
- Reads
- Time, pointer, inputs
How it works, step by step
- 1Add a custom effect
Select a layer and open Custom Effect. You start from working starter code.
- 2Declare params
export const params = { speed: 1, color: "#3b82f6" }. Each one shows up as a control in the inspector.
- 3Write render(ctx, env)
Draw with the canvas API. env gives you width, height, time, params, the pointer and hover and press state.
- 4Talk to the state machine
Read inputs with env.input, set them with env.setInput, and send events with env.emit.
Every control
| Control | What it does |
|---|---|
| params | Numbers and colours that become inspector controls. |
| render(ctx, env) | Called every frame to draw the layer. |
| env.time | Seconds since start, for motion. |
| env.width / env.height | The layer’s size. |
| Pointer | Mouse position (also local to the layer), hover and pressed. |
| env.input / env.setInput | Read and write state machine inputs. |
| env.shader | Run a GLSL fragment shader over the layer. |
What you can make with it
Noise, waves and particle fields.
Game loops that read the pointer and update a score input.
Visuals driven by an input or API value.
Per-letter motion and gradients.
Use it from your code
export const params = { speed: 1, color: "#3b82f6", size: 24 };
export function render(ctx, env) {
const { width, height, time, params } = env;
const x = Math.sin(time * params.speed * 2) * width * 0.25;
const y = Math.cos(time * params.speed * 2) * height * 0.2;
ctx.fillStyle = params.color;
ctx.beginPath();
ctx.arc(x, y, params.size, 0, Math.PI * 2);
ctx.fill();
}Three good tools for this
We make ExodeUI, so weigh our pick with that in mind.
- 1
p5.js
Best forCreative coding sketches
Pick it whenYou want a creative coding library for sketches and art on a web page.
- 2
After Effects expressions
Best forScripted motion in video
Pick it whenYour output is video and you want JavaScript expressions on layer properties.
- 3
ExodeUI
Best forScripted effects inside interactive UI
Pick it whenYou want scripted visuals that sit inside a designed, interactive file and talk to its state machine.
When another tool is the better fit
Effect scripts run on the web runtimes, Flutter and SwiftUI, but not on React Native. For React Native, use timeline, spring and state machine animation instead.
Questions
What language are effect scripts written in?
JavaScript. You export params and a render(ctx, env) function that draws with the canvas 2D API.
How do params become controls?
Each value in the exported params object shows up in the inspector as a number field, slider or colour picker.
Can a script change state machine inputs?
Yes. Use env.setInput to set a value and env.input to read one. env.emit sends an event.
Which runtimes run effect scripts?
The web runtimes, Flutter and SwiftUI. React Native does not run them.
More in the editor
All features →Related reading
Open the editor and try it
Free to start. Your work saves to one open .exode file that you own.