Class: Collection

Kinetic. Collection

new Collection()

Collection constructor. Collection extends Array. This class is used in conjunction with Kinetic.Container#get

Source:

Methods

<static> toCollection(arr)

convert array into a collection

Parameters:
Name Type Description
arr Array
Source:

each(func)

iterate through node array and run a function for each node. The node and index is passed into the function

Parameters:
Name Type Description
func function
Source:
Example
// get all nodes with name foo inside layer, and set x to 10 for each
layer.get('.foo').each(function(shape, n) {
  shape.setX(10);
});

toArray()

convert collection into an array

Source:
KineticJS Copyright © 2015 The contributors to the KineticJS project.
Documentation generated by JSDoc 3.2.2 on Tue Jan 20th 2015 using the DocStrap template.