Created
December 8, 2014 01:04
-
-
Save mplatts/28885ce4dd79dc850536 to your computer and use it in GitHub Desktop.
Famo.us modifier cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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