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):

/ P>

  @property (nonatomic, retain) CCButton * Goldbutton;  

I have installed the basics of gold button in the implementation file of CCNode (Positioning, Phantom Frame, etc.).

CCScene implementation file (placecen square):

  - (zero) setup {_header = [[header alloc] init]; [_header.goldbutton setTarget: Self Selector: @Sillector (Gold Button)]; }  

Inserts a little odd goal of the button inside the scene, but it works if I am thinking 'good practice' for this situation.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -