axmol/cocos2dx/extensions/CCControlExtension/CCMenuPassive.h

81 lines
2.7 KiB
C++

/*
*
* 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
class CC_DLL CCMenuPassive : public CCLayer, public CCRGBAProtocol
{
/** 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();
/** creates a CCMenu with it's items */
static CCMenuPassive* create(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.
*/
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);
/** align items in columns of rows */
void alignItemsInRows(unsigned int rows, ...);
void alignItemsInRows(unsigned int rows, va_list args);
//RGBA protocol
virtual void setOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool isOpacityModifyRGB(void) { return false;}
};
NS_CC_EXT_END
#endif