brianchirls / Seriously.js

A real-time, node-based video effects compositor for the web built with HTML5, Javascript and WebGL
MIT License
3.87k stars 354 forks source link

Setting position of the object within layers #127

Closed etcook closed 8 years ago

etcook commented 8 years ago

I have been looking through the documentation and source code, but it isn't clear to me how you position the item itself within the layer. It automatically positions the source item directly in the center, but if I wanted to offset it, how would I do this?

Thanks for an amazing lib.

felipebrahm commented 8 years ago

@etcook you can use the 2d transforms (translate, scale, rotation, skew) for that. Here's an example on how to use scale: https://github.com/brianchirls/Seriously.js/wiki/Seriously

And here you can find all the different transforms and their arguments: https://github.com/brianchirls/Seriously.js/blob/513d2b8696b76fe764b3033aa6dc7c99005acccd/seriously.js#L5989-L6246

etcook commented 8 years ago

@felipebrahm Thank you for this.