2012-04-19 14:35:52 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* A menu that does not send any events, it's simply a passive container (lets the contents do their own thing) of CCNodes
|
|
|
|
*/
|
|
|
|
#ifndef __CCMENU_PASSIVE_H__
|
|
|
|
#define __CCMENU_PASSIVE_H__
|
|
|
|
|
|
|
|
#include "CCControl.h"
|
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
NS_CC_EXT_BEGIN
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-04-16 23:16:03 +08:00
|
|
|
class CC_DLL CCMenuPassive : public CCLayer, public CCRGBAProtocol
|
2012-04-16 18:58:43 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
/** Color: conforms with CCRGBAProtocol protocol */
|
|
|
|
CC_PROPERTY_PASS_BY_REF(ccColor3B, m_tColor, Color);
|
|
|
|
/** Opacity: conforms with CCRGBAProtocol protocol */
|
|
|
|
CC_PROPERTY(GLubyte, m_cOpacity, Opacity);
|
|
|
|
|
|
|
|
public:
|
2012-06-14 15:13:16 +08:00
|
|
|
/** creates an empty CCMenu
|
2012-06-20 14:31:36 +08:00
|
|
|
@deprecated: This interface will be deprecated sooner or later.
|
2012-06-14 15:13:16 +08:00
|
|
|
*/
|
2012-06-20 11:48:31 +08:00
|
|
|
CC_DEPRECATED_ATTRIBUTE static CCMenuPassive* node();
|
2012-06-14 15:13:16 +08:00
|
|
|
|
|
|
|
/** creates a CCMenu with it's items
|
2012-06-20 14:31:36 +08:00
|
|
|
@deprecated: This interface will be deprecated sooner or later.
|
2012-06-14 15:13:16 +08:00
|
|
|
*/
|
2012-06-20 11:48:31 +08:00
|
|
|
CC_DEPRECATED_ATTRIBUTE static CCMenuPassive* menuWithItems(CCNode* item, ...);
|
2012-06-14 15:13:16 +08:00
|
|
|
|
|
|
|
/** creates a CCMenu with it's item, then use addChild() to add
|
|
|
|
* other items. It is used for script, it can't init with undetermined
|
|
|
|
* number of variables.
|
2012-06-20 14:31:36 +08:00
|
|
|
@deprecated: This interface will be deprecated sooner or later.
|
2012-06-14 15:13:16 +08:00
|
|
|
*/
|
2012-06-20 11:48:31 +08:00
|
|
|
CC_DEPRECATED_ATTRIBUTE static CCMenuPassive* menuWithItem(CCNode* item);
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates an empty CCMenu */
|
2012-06-14 15:13:16 +08:00
|
|
|
static CCMenuPassive* create();
|
2012-04-16 18:58:43 +08:00
|
|
|
|
|
|
|
/** creates a CCMenu with it's items */
|
2012-06-14 15:13:16 +08:00
|
|
|
static CCMenuPassive* create(CCNode* item, ...);
|
2012-04-16 18:58:43 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates a CCMenu with it's item, then use addChild() to add
|
|
|
|
* other items. It is used for script, it can't init with undetermined
|
|
|
|
* number of variables.
|
|
|
|
*/
|
2012-06-14 15:13:16 +08:00
|
|
|
static CCMenuPassive* createWithItem(CCNode* item);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
/** initializes a CCMenu with it's items */
|
|
|
|
bool initWithItems(CCNode* item, 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(unsigned int columns, ...);
|
|
|
|
void alignItemsInColumns(unsigned int columns, va_list args);
|
2012-04-16 18:58:43 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
/** align items in columns of rows */
|
|
|
|
void alignItemsInRows(unsigned int rows, ...);
|
|
|
|
void alignItemsInRows(unsigned int rows, va_list args);
|
2012-04-16 18:58:43 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
//RGBA protocol
|
2012-06-15 15:10:40 +08:00
|
|
|
virtual void setOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
|
|
|
|
virtual bool isOpacityModifyRGB(void) { return false;}
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
2012-04-16 18:58:43 +08:00
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
NS_CC_EXT_END
|
2012-04-16 18:58:43 +08:00
|
|
|
|
|
|
|
#endif
|