Class Index | File Index

Classes


Class CAAT.Foundation.ActorContainer


Extends CAAT.Foundation.Actor.

Defined in: ActorContainer.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<private>  
This container active children.
<private>  
Container redimension policy when adding children: 0 : no resize.
<private>  
If container redimension on children add, use this rectangle as bounding box store.
 
This container children.
 
 
Define a layout manager for this container that enforces children position and/or sizes.
<private>  
This container pending to be added children.
<private>  
Spare rectangle to avoid new allocations when adding children to this container.
Fields borrowed from class CAAT.Foundation.Actor:
__super, AABB, alpha, backgroundImage, behaviorList, cached, clip, clipPath, dirty, discardable, duration, expired, fillStyle, frameAlpha, gestureEnabled, glEnabled, height, id, inFrame, invalid, isAA, isCachedActor, isGlobalAlpha, lifecycleListenerList, minimumSize, modelViewMatrix, modelViewMatrixI, mouseEnabled, oldX, oldY, parent, pointed, preferredSize, preventLayout, rotationAngle, rotationX, rotationY, scaleAnchor, scaleTX, scaleTY, scaleX, scaleY, size_active, size_total, start_time, strokeStyle, tAnchorX, tAnchorY, time, viewVertices, visible, wdirty, width, worldModelViewMatrix, worldModelViewMatrixI, x, y
Method Summary
Method Attributes Method Name and Description
<private>  
__init(hint)
Constructor delegate
<private>  
__paintActor(director, time)
<private>  
<private>  
 
addActor(child, constraint)
 
addActorImmediately(child, constraint)
 
addChild(child, constraint)
Adds an Actor to this ActorContainer.
 
addChildAt(child, index)
Adds an Actor to this ActorContainer.
 
addChildDelayed(child, constraint)
Add a child element and make it active in the next frame.
 
addChildImmediately(child, constraint)
Adds an Actor to this Container.
 
animate(director, time)
Private.
 
Destroys this ActorContainer.
 
drawScreenBoundingBox(director, time)
Draws this ActorContainer and all of its children screen bounding box.
 
Removes all children from this ActorContainer.
 
endAnimate(director, time)
Removes Actors from this ActorContainer which are expired and flagged as Discardable.
<private>  
 
Find the first actor with the supplied ID.
 
findChild(child)
Private Gets a contained Actor z-index on this ActorContainer.
 
getChildAt(iPosition)
Returns the Actor at the iPosition(th) position.
 
 
 
Get number of Actors into this container.
 
 
paintActor(director, time)
Private Paints this container and every contained children.
 
paintActorGL(director, time)
 
Recalc this container size by computing the union of every children bounding box.
 
removeChild(child)
Removed an Actor form this ActorContainer.
 
 
 
 
setBounds(x, y, w, h)
 
setLayout(layout)
 
setZOrder(actor, index)
Changes an actor's ZOrder.
Methods borrowed from class CAAT.Foundation.Actor:
__scale1To, addAnimation, addBehavior, addListener, cacheAsBitmap, centerAt, centerOn, clean, contains, create, disableDrag, emptyBehaviorList, enableDrag, enableEvents, fireEvent, gestureChange, gestureEnd, gestureStart, getAnchor, getAnchorPercent, getBehavior, getId, getMinimumSize, getPreferredSize, getTextureGLPage, glNeedsFlush, glSetShader, initialize, invalidate, isCached, isGestureEnabled, isInAnimationFrame, isVisible, modelToModel, modelToView, mouseClick, mouseDblClick, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseOut, mouseOver, mouseUp, moveTo, paint, playAnimation, removeBehaviorById, removeBehaviour, removeListener, resetAnimationTime, resetAsButton, resetTransform, rotateTo, scaleTo, scaleXTo, scaleYTo, setAlpha, setAnimationEndCallback, setAnimationImageIndex, setAsButton, setBackgroundImage, setBackgroundImageOffset, setButtonImageIndex, setCachedActor, setChangeFPS, setClip, setDiscardable, setExpired, setFillStyle, setFrameTime, setGestureEnabled, setGLCoords, setGlobalAlpha, setGlobalAnchor, setId, setImageTransformation, setLocation, setMinimumSize, setModelViewMatrix, setOutOfFrameTime, setPaint, setParent, setPosition, setPositionAnchor, setPositionAnchored, setPreferredSize, setPreventLayout, setRotation, setRotationAnchor, setRotationAnchored, setScale, setScaleAnchor, setScaleAnchored, setScreenBounds, setSize, setSpriteIndex, setStrokeStyle, setUV, setVisible, stopCacheAsBitmap, touchEnd, touchMove, touchStart, viewToModel
Class Detail
CAAT.Foundation.ActorContainer()
Field Detail
<private> activeChildren
This container active children.

<private> addHint
Container redimension policy when adding children: 0 : no resize. CAAT.Foundation.ActorContainer.AddHint.CONFORM : resize container to a bounding box.

<private> boundingBox
If container redimension on children add, use this rectangle as bounding box store.

childrenList
This container children.

layoutInvalidated

layoutManager
Define a layout manager for this container that enforces children position and/or sizes.
See:
demo26 for an example of layouts.

<private> pendingChildrenList
This container pending to be added children.

<private> runion
Spare rectangle to avoid new allocations when adding children to this container.
Method Detail
<private> {*} __init(hint)
Constructor delegate
Parameters:
hint
{CAAT.Foundation.ActorContainer.AddHint}
Returns:
{*}

<private> __paintActor(director, time)
Parameters:
director
time

<private> __validateLayout()

<private> __validateTree()

addActor(child, constraint)
Parameters:
child
constraint

addActorImmediately(child, constraint)
Parameters:
child
constraint

addChild(child, constraint)
Adds an Actor to this ActorContainer. The Actor will be added to the container AFTER frame animation, and not on method call time. Except the Director and in orther to avoid visual artifacts, the developer SHOULD NOT call this method directly. If the container has addingHint as CAAT.Foundation.ActorContainer.AddHint.CONFORM, new continer size will be calculated by summing up the union of every client actor bounding box. This method will not take into acount actor's affine transformations, so the bounding box will be AABB.
Parameters:
child
{CAAT.Foundation.Actor} object instance.
constraint
{object}
Returns:
this

addChildAt(child, index)
Adds an Actor to this ActorContainer.
Parameters:
child
{CAAT.Foundation.Actor}.
index
{number}
Returns:
this

addChildDelayed(child, constraint)
Add a child element and make it active in the next frame.
Parameters:
child
{CAAT.Foundation.Actor}
constraint

addChildImmediately(child, constraint)
Adds an Actor to this Container. The Actor will be added ON METHOD CALL, despite the rendering pipeline stage being executed at the time of method call. This method is only used by director's transitionScene.
Parameters:
child
{CAAT.Foundation.Actor}
constraint
{object}
Returns:
this.

{boolean} animate(director, time)
Private. Performs the animate method for this ActorContainer and every contained Actor.
Parameters:
director
the CAAT.Foundation.Director object instance that contains the Scene the Actor is in.
time
an integer indicating the Scene time when the bounding box is to be drawn.
Returns:
{boolean} is this actor in active children list ??

destroy()
Destroys this ActorContainer. The process falls down recursively for each contained Actor into this ActorContainer.
Returns:
this

drawScreenBoundingBox(director, time)
Draws this ActorContainer and all of its children screen bounding box.
Parameters:
director
the CAAT.Foundation.Director object instance that contains the Scene the Actor is in.
time
an integer indicating the Scene time when the bounding box is to be drawn.

emptyChildren()
Removes all children from this ActorContainer.
Returns:
this

endAnimate(director, time)
Removes Actors from this ActorContainer which are expired and flagged as Discardable.
Parameters:
director
the CAAT.Foundation.Director object instance that contains the Scene the Actor is in.
time
an integer indicating the Scene time when the bounding box is to be drawn.

<private> findActorAtPosition(point)
Parameters:
point
an object of the form { x: float, y: float }
Returns:
the Actor contained inside this ActorContainer if found, or the ActorContainer itself.

findActorById(id)
Find the first actor with the supplied ID. This method is not recommended to be used since executes a linear search.
Parameters:
id

{number} findChild(child)
Private Gets a contained Actor z-index on this ActorContainer.
Parameters:
child
a CAAT.Foundation.Actor object instance.
Returns:
{number}

getChildAt(iPosition)
Returns the Actor at the iPosition(th) position.
Parameters:
iPosition
an integer indicating the position array.
Returns:
the CAAT.Foundation.Actor object at position.

getLayout()

getNumActiveChildren()

getNumChildren()
Get number of Actors into this container.
Returns:
integer indicating the number of children.

invalidateLayout()

paintActor(director, time)
Private Paints this container and every contained children.
Parameters:
director
the CAAT.Foundation.Director object instance that contains the Scene the Actor is in.
time
an integer indicating the Scene time when the bounding box is to be drawn.

paintActorGL(director, time)
Parameters:
director
time

recalcSize()
Recalc this container size by computing the union of every children bounding box.

removeChild(child)
Removed an Actor form this ActorContainer. If the Actor is not contained into this Container, nothing happends.
Parameters:
child
a CAAT.Foundation.Actor object instance.
Returns:
this

removeChildAt(pos)
Parameters:
pos

removeFirstChild()

removeLastChild()

setBounds(x, y, w, h)
Parameters:
x
y
w
h

setLayout(layout)
Parameters:
layout

setZOrder(actor, index)
Changes an actor's ZOrder.
Parameters:
actor
the actor to change ZOrder for
index
an integer indicating the new ZOrder. a value greater than children list size means to be the last ZOrder Actor.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:17 GMT-0700 (PDT)