Core.LayoutNode Class
Defined in:
samsara/core/LayoutNode.js:9
Encapsulates a stream of layout data (transform, origin, align, opacity). Listens on start/update/end events, batches them, and emits them downstream to descendant layout nodes.
Constructor
Core.LayoutNode
(
private
-
sources
Parameters:
Example:
var context = Context();
var surface = new Surface({
size : [100,100],
properties : {background : 'red'}
});
var opacity = new Transitionable(1);
var layout = new LayoutNode({
transform : Transform.translateX(100),
opacity : opacity
});
context.add(layout).add(surface);
context.mount(document.body)
opacity.set(0, {duration : 1000});
Item Index
Methods
Methods
set
(
-
sources
Introduce new data streams to the layout node in {key : value} pairs.
Here the key
is one of "transform", "origin", "align" or "opacity".
The value
is either a stream, or a simple type like a Number
or Array
.
Simple types will be wrapped in an Observerable
to emit appropriate events.
Parameters:
-
sources
ObjectObject of data sources