Skip to content

Instantly share code, notes, and snippets.

@mplatts
Created December 8, 2014 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mplatts/28885ce4dd79dc850536 to your computer and use it in GitHub Desktop.
Save mplatts/28885ce4dd79dc850536 to your computer and use it in GitHub Desktop.
Famo.us modifier cheatsheet
var mod = new Modifier({
origin: [0.5, 0],
align: [0.5, 0],
opacity: 0.3,
transform: Transform.translate(0, 10, 1) // can be a function that runs every tick
})
mod.transformFrom(transform); // evaluated every tick
mod.opacityFrom(0.3);
mod.originFrom(0.5);
mod.alignFrom(0.5);
mod.sizeFrom([100,100])
Transform.translate(x, y, z);
Transform.scale(x, y, z);
Transform.rotateX(theta);
Transform.rotateY(theta);
Transform.rotateZ(theta);
Transform.rotate(x, y, z)
Transform.skew(x, y, z)
// Modifier:
// A collection of visual changes to be applied to another renderable component.
// This collection includes a transform matrix, an opacity constant, a size, an
// origin specifier. Modifier objects can be added to any RenderNode or object
// capable of displaying renderables. The Modifier's children and descendants
// are transformed by the amounts specified in the Modifier's properties.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment