Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8ff70902d0
Fetching contributors…

Cannot retrieve contributors at this time

file 74 lines (60 sloc) 1.971 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
/* cocos2d for iPhone
*
* http://www.cocos2d-iphone.org
*
* Copyright (C) 2008,2009 Ricardo Quesada
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the 'cocos2d for iPhone' license.
*
* You will find a copy of this license within the cocos2d for iPhone
* distribution inside the "LICENSE" file.
*
*/

#import <UIKit/UIKit.h>

#import "CCMenuItem.h"
#import "CCLayer.h"

typedef enum {
kMenuStateWaiting,
kMenuStateTrackingTouch
} MenuState;

/** A CCMenu
*
* Features and Limitation:
* - You can add MenuItem objects in runtime using addChild:
* - But the only accecpted children are MenuItem objects
*/
@interface CCMenu : CCLayer <CCRGBAProtocol>
{
MenuState state;
CCMenuItem *selectedItem;
GLubyte opacity_;
ccColor3B color_;
}

/** creates a CCMenu with it's items */
+ (id) menuWithItems: (CCMenuItem*) item, ... NS_REQUIRES_NIL_TERMINATION;

/** initializes a CCMenu with it's items */
- (id) initWithItems: (CCMenuItem*) item vaList: (va_list) args;

/** align items vertically */
-(void) alignItemsVertically;
/** align items vertically with padding
@since v0.7.2
*/
-(void) alignItemsVerticallyWithPadding:(float) padding;

/** align items horizontally */
-(void) alignItemsHorizontally;
/** align items horizontally with padding
@since v0.7.2
*/
-(void) alignItemsHorizontallyWithPadding: (float) padding;


/** align items in rows of columns */
-(void) alignItemsInColumns: (NSNumber *) columns, ... NS_REQUIRES_NIL_TERMINATION;
-(void) alignItemsInColumns: (NSNumber *) columns vaList: (va_list) args;

/** align items in columns of rows */
-(void) alignItemsInRows: (NSNumber *) rows, ... NS_REQUIRES_NIL_TERMINATION;
-(void) alignItemsInRows: (NSNumber *) rows vaList: (va_list) args;


/** conforms to CCRGBAProtocol protocol */
@property (nonatomic,readonly) GLubyte opacity;
/** conforms to CCRGBAProtocol protocol */
@property (nonatomic,readonly) ccColor3B color;

@end
Something went wrong with that request. Please try again.