cocos2d-iphone-extensions
0.2
Cocos2D Extensions API Reference (iOS version) for Kobold2D developers
|
Public Member Functions | |
void | alignItemsHorizontallyWithPadding: (float padding) |
void | alignItemsVerticallyWithPadding: (float padding) |
void | alignItemsHorizontallyWithPadding:leftToRight: (float padding,[leftToRight] BOOL leftToRight) |
void | alignItemsVerticallyWithPadding:bottomToTop: (float padding,[bottomToTop] BOOL 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 |
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
void CCMenuAdvanced::alignItemsHorizontallyWithPadding: | ( | float | padding | ) | [virtual] |
AlignH items horizontal from left to right.
padding | space between elements. |
void CCMenuAdvanced::alignItemsHorizontallyWithPadding:leftToRight: | ( | float | padding, |
[leftToRight] BOOL | leftToRight | ||
) | [virtual] |
Designated alignHorizontal Method
padding | space between elements. |
leftRoRight | If YES - align items from left to right, if NO - right to left. |
void CCMenuAdvanced::alignItemsVerticallyWithPadding: | ( | float | padding | ) | [virtual] |
Designated alignVerticall from bottom to top.
padding | space between elements. |
void CCMenuAdvanced::alignItemsVerticallyWithPadding:bottomToTop: | ( | float | padding, |
[bottomToTop] BOOL | bottomToTop | ||
) | [virtual] |
Designated alignVerticall Method
padding | space between elements. |
bottomToTop | If YES - align items from bottom to top, if NO - top to bottom. |
void CCMenuAdvanced::fixPosition | ( | ) | [virtual] |
Changes menu position to stay inside of boundaryRect if it is non-null.
CGRect CCMenuAdvanced::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 CCMenuAdvanced::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 CCMenuAdvanced::minimumTouchLengthToSlide [read, write, assign] |
Minimum length of touch, that will disable selected menu item & start scrolling.
NSInteger CCMenuAdvanced::priority [read, write, assign] |
Priority property for touch, mouse & keyboard for menu. Must be set before onEnter called.