cocos2d iphone - Handle Button in CCNode from CCScene -
I am creating a game in cocos2d v3. In CCScene , I add a CCNode which contains all components of my HUD. In CCNode, CCButton s has been added. I want to be able to handle the touch of these buttons in my CCScene Is this possible?
CcdAD header file (header class):
I have installed the basics of gold button in the implementation file of CCNode (Positioning, Phantom Frame, etc.). Inserts a little odd goal of the button inside the scene, but it works if I am thinking 'good practice' for this situation. / P>
@property (nonatomic, retain) CCButton * Goldbutton; CCScene implementation file (placecen square):
- (zero) setup {_header = [[header alloc] init]; [_header.goldbutton setTarget: Self Selector: @Sillector (Gold Button)]; }
Comments
Post a Comment