mplatts
12/8/2014 - 1:04 AM

Famo.us modifier cheatsheet

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.