Extends
Requires
- module:Sprite
 
Methods
- 
    
addItem(item, name)
 - 
    
    
Add an item with optional name
Parameters:
Name Type Argument Description itemAny The item to add
nameString <optional> 
The optional name of the item
- Inherited From:
 - Source:
 
Returns:
- Type
 - Collection
 
 - 
    
addItems(items)
 - 
    
    
Add multiple items
Parameters:
Name Type Argument Description itemsObject <repeatable> 
Can be the object itself or an object containing the entity and it's name
eg:{ item: Entity, name: 'entityName' }- Inherited From:
 - Source:
 
Returns:
- Type
 - Collection
 
 - 
    
each(fn, scope)
 - 
    
    
Iterates the collection's sorted items. The item, index, and name are supplied
to the provided functionParameters:
Name Type Argument Description fnfunction The function to execute on the iterable
scopeObject <optional> 
The scope with which to execute the function
- Inherited From:
 - Source:
 
 - 
    
filter(fn, scope)
 - 
    
    
iterates items and return the ones that meet criteria
Parameters:
Name Type Argument Description fnfunction Truth predicate
scopeObject <optional> 
The scope with which to execute the function
- Inherited From:
 - Source:
 
Returns:
- Type
 - Array
 
 - 
    
getItem(name)
 - 
    
    
Returns an existing item by name, or undefined if the name is not found
Parameters:
Name Type Description nameString The name of the item
- Inherited From:
 - Source:
 
Returns:
- Type
 - Any
 
 - 
    
getItemArray()
 - 
    
    
Returns a list of just the items
- Inherited From:
 - Source:
 
Returns:
- Type
 - Array
 
 - 
    
getItemAt(index)
 - 
    
    
Returns an existing item by index
Parameters:
Name Type Description indexInteger - Inherited From:
 - Source:
 
Returns:
- Type
 - Any
 
 - 
    
getItemCount()
 - 
    
    
Returns the count of items in collection
- Inherited From:
 - Source:
 
Returns:
- Type
 - Integer
 
 - 
    
getItemIndex(name)
 - 
    
    
Returns an item's current index
Parameters:
Name Type Description nameString - Inherited From:
 - Source:
 
Returns:
- Type
 - Integer
 
 - 
    
removeAllItems()
 - 
    
    
Removes all items from collection
- Inherited From:
 - Source:
 
 - 
    
render(context)
 - 
    
    
Renders all children recursively on top of own transformation stack
Parameters:
Name Type Description contextObject The 2d context object
 - 
    
setItem(name, value)
 - 
    
    
Assigns a new value to an existing item
Parameters:
Name Type Description nameString The name of the object to modify
valueAny The new value
- Inherited From:
 - Source:
 
 - 
    
setItemIndex(name, index)
 - 
    
    
Moves item to new index
Parameters:
Name Type Description nameString The name of the object being moved
indexInteger The item's new index
- Inherited From:
 - Source: