View all expressions
Conditional

Text Change Based on Layer Position

Checks where your layer sits on screen and updates its text to match which quadrant it’s in.

Contributed by:


if (position[0] < thisComp.width / 2 && position[1] < thisComp.height / 2) {
 "Top Left";
} else if (position[0] > thisComp.width / 2 && position[1] < thisComp.height / 2) {
 "Top Right";
} else if (position[0] < thisComp.width / 2) {
 "Bottom Left";
} else {
 "Bottom Right";
}

Text Change Based on Layer Position

Practical use case

Auto-label elements like “Top Left” or “Bottom Right” as you drag them around the comp. Handy for interactive mockups.

Check out similar expressions

Data-driven video workflows for After Effects are easier with Plainly.

a mesh of elegant lines transparent image