title: Using CCMenuItemImage to create single buttons in the hud layer
body: <p>I just started a game using cocos2d-iphone and I am trying to add a pause botton in my hud.
  My hud will have:</p>
  
  <ul>
  <li>Time left</li>
  <li>HP bar</li>
  <li>Pause button</li>
  </ul>
  
  <p>I have been reading Ray Wenderlich's <a href="http://www.raywenderlich.com/414/how-to-create-buttons-in-cocos2d-simple-radio-and-toggle" rel="nofollow">tutorials</a> and he mentions for buttons <code>CCMenuItemImage</code> should be used. I first did:</p>
  
  <pre><code>CCMenuItemImage *pauseButton = [CCMenuItemImage itemFromNormalImage:@"hud_pause_bt.png" selectedImage:@"hud_pause_bt.png" target:self selector:@selector(pauseAction:)];
  pauseButton.position = ccp(winSize.width - pauseButton.rect.size.width/1.8, winSize.height - pauseButton.rect.size.height/1.8);
  
  [self addChild:pauseButton];
  </code></pre>
  
  <p>but I was never reaching the pauseAction method. Afterwards I tried adding the <code>CCMenuItemImage</code> to a <code>CCMenu</code> with the following code:</p>
  
  <pre><code>CGSize winSize = [CCDirector sharedDirector].winSize;
  
  CCMenuItemImage *pauseButton = [CCMenuItemImage itemFromNormalImage:@"hud_pause_bt.png" selectedImage:@"hud_pause_bt.png" target:self selector:@selector(pauseAction:)];
  
  pauseButton.position = ccp(winSize.width - pauseButton.rect.size.width/1.8, winSize.height - pauseButton.rect.size.height/1.8);
  
  CCMenu *pauseMenu = [CCMenu menuWithItems:pauseButton, nil];
  pauseMenu.position = CGPointZero;
  [self addChild:pauseMenu];
  </code></pre>
  
  <p>In this case the touches work but it feels wrong to create a <code>CCMenu</code> just to make my <code>CCMenuItemImage</code> clickable.</p>
  
  <p>What do you think?</p>