-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathSneakyButton.h
38 lines (30 loc) · 1.11 KB
/
SneakyButton.h
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
#ifndef __SNEAKY_BUTTON_H__
#define __SNEAKY_BUTTON_H__
#include "cocos2d.h"
class SneakyButton : public cocos2d::CCNode, public cocos2d::CCTargetedTouchDelegate
{
protected:
cocos2d::CCPoint center;
float radiusSq;
cocos2d::CCRect bounds;
CC_SYNTHESIZE(bool, status, Status);
CC_SYNTHESIZE_READONLY(bool, active, IsActive);
CC_SYNTHESIZE_READONLY(bool, value, Value);
CC_SYNTHESIZE(bool, isHoldable, IsHoldable);
CC_SYNTHESIZE(bool, isToggleable, IsToggleable);
CC_SYNTHESIZE(float, rateLimit, RateLimit);
CC_SYNTHESIZE_READONLY(float, radius, Radius);
//Public methods
virtual void onEnterTransitionDidFinish();
virtual void onExit();
bool initWithRect(cocos2d::CCRect rect);
void limiter(float delta);
void setRadius(float r);
virtual bool ccTouchBegan(cocos2d::CCTouch *touch, cocos2d::CCEvent *event);
virtual void ccTouchMoved(cocos2d::CCTouch *touch, cocos2d::CCEvent *event);
virtual void ccTouchEnded(cocos2d::CCTouch *touch, cocos2d::CCEvent *event);
virtual void ccTouchCancelled(cocos2d::CCTouch *touch, cocos2d::CCEvent *event);
void touchDelegateRelease();
void touchDelegateRetain();
};
#endif