CCLayout Class Reference

Inherits from CCNode : CCResponder : NSObject
Declared in CCLayout.h

Overview

The layout node is an abstract class. It will take control of its childrens' positions.

Do not create instances of CCLayout, instead use one of its subclasses:

Note: If you are using a layout node you should not set the positions of the layout node’s children manually or via move actions.

Subclassing Note

CCLayout is an abstract class for nodes that provide layouts. You should subclass CCLayout to create your own layout node. Implement the layout method to create your own layout.

Methods Implemented by Subclasses

– needsLayout

Called whenever the node needs to layout its children again. Normally, there is no need to call this method directly.

- (void)needsLayout

Declared In

CCLayout.h

– layout

The layout method layouts the children according to the rules implemented in a CCLayout subclass.

- (void)layout

Discussion

Note: Your subclass must call [super layout] to reset the _needsLayout flag. Not calling super could cause the layout to unnecessarily run the layout method every frame.

Declared In

CCLayout.h