Skip to main content

xyTranslate()v4.0.467

Part of the @remotion/effects package.

A translate effect that moves a canvas-based component by an absolute pixel offset.

It can be applied to components such as <Video>, <HtmlInCanvas> and <Solid>.

Preview

Example

MyComp.tsx
import {AbsoluteFill} from 'remotion'; import {Video} from '@remotion/media'; import {xyTranslate} from '@remotion/effects/translate'; export const MyComp: React.FC = () => { return ( <AbsoluteFill> <Video src="https://remotion.media/video.mp4" effects={[xyTranslate({x: 120, y: 80})]} /> </AbsoluteFill> ); };

API

Pass an object with the following properties. You can also call xyTranslate() without arguments.

x?

Horizontal offset in pixels. Defaults to 0.

Positive values move the image to the right, negative values move it to the left.

y?

Vertical offset in pixels. Defaults to 0.

Positive values move the image down, negative values move it up.

disabled?

When true, the effect is skipped. Defaults to false.

See also