cocos2d-iphone-extensions  0.2
Cocos2D Extensions API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Properties
CCMenuAdvanced Class Reference

List of all members.

Public Member Functions

(void) - alignItemsHorizontallyWithPadding:
(void) - alignItemsVerticallyWithPadding:
(void) - alignItemsHorizontallyWithPadding:leftToRight:
(void) - alignItemsVerticallyWithPadding:bottomToTop:
(void) - fixPosition
(void) - selectNextMenuItem
(void) - selectPrevMenuItem
(void) - activateSelectedItem
(void) - cancelSelectedItem

Protected Attributes

NSInteger priority_
int selectedItemNumber_
CGRect boundaryRect_
CGFloat minimumTouchLengthToSlide_
CGFloat curTouchLength_
BOOL isDisabled_

Properties

CGRect boundaryRect
CGFloat minimumTouchLengthToSlide
NSInteger priority
BOOL isDisabled

Detailed Description

some aditional features.

   1) Selecting and activating CCMenuItems with Keyboard 

(by default next/prev bindings aren't set - set them manually or use one of align methods to bind arrows for this). 2) One of CCMenuItems can be set as escapeDelegate - so it will be activated by pressing escape 3) align left->right, right->left, bottom->top, top->bottom with autosetting self contentSize 4) externalBoundsRect - if it is set then menu items will be scrollable inside these bounds 5) priority property - must be set before onEnter to make it register with that priority


Member Function Documentation

- (void) alignItemsHorizontallyWithPadding: (float)  padding

AlignH items horizontal from left to right.

Parameters:
paddingspace between elements.
- (void) alignItemsHorizontallyWithPadding: (float)  padding
leftToRight: (BOOL)  leftToRight 

Designated alignHorizontal Method

Parameters:
paddingspace between elements.
leftRoRightIf YES - align items from left to right, if NO - right to left.
- (void) alignItemsVerticallyWithPadding: (float)  padding

Designated alignVerticall from bottom to top.

Parameters:
paddingspace between elements.
- (void) alignItemsVerticallyWithPadding: (float)  padding
bottomToTop: (BOOL)  bottomToTop 

Designated alignVerticall Method

Parameters:
paddingspace between elements.
bottomToTopIf YES - align items from bottom to top, if NO - top to bottom.
- (void) fixPosition

Changes menu position to stay inside of boundaryRect if it is non-null.


Property Documentation

- (CGRect) boundaryRect [read, write, assign]

Rectangle in parent's coordinate system, which menu must fill with it's boundingBox.

Note: boundaryRect must have greater size then menu's boundingBox to make scrolling possible. Think about boundaryRect like about hole in paper sheet under which you would like to put CCMenuAdvanced and scroll it, but you never want to see the table - hole must be covered with paper.

- (BOOL) isDisabled [read, write, assign]

If YES - all touches & keyboard events will be ignored. If NO - all events will work, except for disabled items. Default is NO.

- (CGFloat) minimumTouchLengthToSlide [read, write, assign]

Minimum length of touch, that will disable selected menu item & start scrolling.

- (NSInteger) priority [read, write, assign]

Priority property for touch, mouse & keyboard for menu. Must be set before onEnter called.


The documentation for this class was generated from the following file: