axmol/cocos2dx/extensions/CCControlExtension/CCMenuPassive.h

81 lines
2.7 KiB
C
Raw Normal View History

/*
*
* 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"
NS_CC_EXT_BEGIN
2012-04-16 23:16:03 +08:00
class CC_DLL CCMenuPassive : public CCLayer, public CCRGBAProtocol
2012-04-16 18:58:43 +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:
/** creates an empty CCMenu
@warning: This interface will be deprecated in future.
*/
//static CCMenuPassive* node();
/** creates a CCMenu with it's items
@warning: This interface will be deprecated in future.
*/
//static CCMenuPassive* menuWithItems(CCNode* item, ...);
/** 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.
@warning: This interface will be deprecated in future.
*/
//static CCMenuPassive* menuWithItem(CCNode* item);
/** creates an empty CCMenu */
static CCMenuPassive* create();
2012-04-16 18:58:43 +08:00
/** creates a CCMenu with it's items */
static CCMenuPassive* create(CCNode* item, ...);
2012-04-16 18:58:43 +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.
*/
static CCMenuPassive* createWithItem(CCNode* item);
/** 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
/** 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
//RGBA protocol
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
};
2012-04-16 18:58:43 +08:00
NS_CC_EXT_END
2012-04-16 18:58:43 +08:00
#endif