2013-04-03 16:29:16 +08:00
|
|
|
typedef enum {
|
|
|
|
kCCTouchesAllAtOnce,
|
|
|
|
kCCTouchesOneByOne,
|
|
|
|
} ccTouchesMode;
|
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
class CCLayer : public CCNode
|
|
|
|
{
|
2012-06-15 17:26:11 +08:00
|
|
|
void setTouchEnabled(bool bValue);
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isTouchEnabled() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2012-06-15 17:26:11 +08:00
|
|
|
void setAccelerometerEnabled(bool bValue);
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isAccelerometerEnabled() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2012-06-15 17:26:11 +08:00
|
|
|
void setKeypadEnabled(bool bValue);
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isKeypadEnabled() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2013-04-03 16:29:16 +08:00
|
|
|
virtual void setTouchMode(ccTouchesMode mode);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual int getTouchMode() const;
|
2013-04-03 16:29:16 +08:00
|
|
|
virtual void setTouchPriority(int priority);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual int getTouchPriority() const;
|
2013-07-26 15:21:19 +08:00
|
|
|
virtual void setSwallowsTouches(bool swallowsTouches);
|
|
|
|
virtual bool isSwallowsTouches() const;
|
2013-04-03 16:29:16 +08:00
|
|
|
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCLayer *create(void);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
class CCLayerRGBA : public CCLayer, public CCRGBAProtocol
|
|
|
|
{
|
|
|
|
static CCLayerRGBA* create();
|
|
|
|
|
|
|
|
CCLayerRGBA();
|
|
|
|
virtual ~CCLayerRGBA();
|
|
|
|
|
|
|
|
virtual bool init();
|
|
|
|
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual GLubyte getOpacity() const;
|
|
|
|
virtual GLubyte getDisplayedOpacity() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
virtual void setOpacity(GLubyte opacity);
|
|
|
|
virtual void updateDisplayedOpacity(GLubyte parentOpacity);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual bool isCascadeOpacityEnabled() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled);
|
|
|
|
|
2013-07-08 11:34:31 +08:00
|
|
|
virtual const Color3B& getColor() const;
|
|
|
|
virtual const Color3B& getDisplayedColor() const;
|
|
|
|
virtual void setColor(const Color3B& color);
|
|
|
|
virtual void updateDisplayedColor(const Color3B& parentColor);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual bool isCascadeColorEnabled() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
virtual void setCascadeColorEnabled(bool cascadeColorEnabled);
|
|
|
|
|
|
|
|
virtual void setOpacityModifyRGB(bool bValue);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual bool isOpacityModifyRGB() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCLayerColor : public CCLayerRGBA
|
2012-02-02 14:26:38 +08:00
|
|
|
{
|
|
|
|
void changeWidth(GLfloat w);
|
|
|
|
void changeHeight(GLfloat h);
|
|
|
|
void changeWidthAndHeight(GLfloat w ,GLfloat h);
|
|
|
|
|
2012-08-10 18:14:04 +08:00
|
|
|
void setContentSize(const CCSize & var);
|
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
void setOpacity(GLubyte var);
|
2013-07-08 11:34:31 +08:00
|
|
|
void setColor(Color3B Value);
|
|
|
|
void setBlendFunc(BlendFunc Value);
|
|
|
|
BlendFunc getBlendFunc(void) const;
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2012-08-10 18:14:04 +08:00
|
|
|
void setOpacityModifyRGB(bool bValue);
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isOpacityModifyRGB(void) const;
|
2012-08-10 18:14:04 +08:00
|
|
|
|
2013-07-08 11:34:31 +08:00
|
|
|
static CCLayerColor * create(Color4B color, GLfloat width, GLfloat height);
|
|
|
|
static CCLayerColor * create(Color4B color);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCLayerGradient : public CCLayerColor
|
|
|
|
{
|
2013-07-08 11:34:31 +08:00
|
|
|
void setStartColor(Color3B colors);
|
|
|
|
Color3B getStartColor() const;
|
|
|
|
void setEndColor(Color3B Value);
|
|
|
|
Color3B getEndColor(void) const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setStartOpacity(GLubyte Value);
|
|
|
|
GLubyte getStartOpacity(void);
|
|
|
|
void setEndOpacity(GLubyte Value);
|
|
|
|
GLubyte getEndOpacity(void);
|
|
|
|
void setVector(CCPoint Value);
|
|
|
|
CCPoint getVector(void);
|
|
|
|
|
2012-06-15 17:26:11 +08:00
|
|
|
void setCompressedInterpolation(bool Value);
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isCompressedInterpolation(void) const;
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2013-07-08 11:34:31 +08:00
|
|
|
static CCLayerGradient* create(Color4B start, Color4B end, CCPoint v);
|
|
|
|
static CCLayerGradient* create(Color4B start, Color4B end);
|
2013-04-02 17:52:08 +08:00
|
|
|
static CCLayerGradient* create();
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCLayerMultiplex : public CCLayer
|
|
|
|
{
|
|
|
|
void addLayer(CCLayer* layer);
|
|
|
|
void switchTo(unsigned int n);
|
|
|
|
void switchToAndReleaseMe(unsigned int n);
|
|
|
|
|
2013-04-03 16:29:16 +08:00
|
|
|
static CCLayerMultiplex* createWithArray(CCArray* arrayOfLayers);
|
|
|
|
static CCLayerMultiplex * create();
|
2012-06-27 14:21:29 +08:00
|
|
|
static CCLayerMultiplex * createWithLayer(CCLayer* layer);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|