offset
Moves the picture, what leaves one edge coming back in at the other.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";
// offset: Moves the picture, what leaves one edge coming back in at the other.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip
id="shot"
src="asset:redCup"
in={18}
out={21}
fit="cover"
effects={[
{
type: "offset",
x: [
{ at: 0.5, value: 0, easing: "easeInOut" },
{ at: 1.5, value: 320 },
],
y: [
{ at: 0.5, value: 0, easing: "easeInOut" },
{ at: 1.5, value: 90 },
],
},
]}
/>
</Track>
</Composition>
);
}The coffee footage is Pixabay videos 209419, 209424, 46989 and 251, under the Pixabay Content License. The maker of the machine in the red cup shot has nothing to do with this project.
Params
Drawn as a shader.
| param | type | default | description |
|---|---|---|---|
x | number (-10000..10000) | 0 | How far the picture moves right, in pixels; negative moves it left. |
y | number (-10000..10000) | 0 | How far the picture moves down, in pixels; negative moves it up. |
wrap | boolean | true | Bring what leaves one edge back in at the opposite edge, instead of holding the edge's pixels. |