title: cocos2d:Drawing CCSprite from one layer to another
body: <p><strong>cocos2d:In</strong> general , this situation : There are two layers :
  1) HelloWorldLayer (main ) and Hudlayer :</p>
  
  <pre><code>@ implementation HelloWorldLayer.
  + (CCScene *) scene
  {
  / / 'Scene' is an autorelease object.
  CCScene * scene = [CCScene node];
      
  / / 'Layer' is an autorelease object.
  HelloWorldLayer * layer = [HelloWorldLayer node];
      
  / / Add layer as a child to scene
  [scene addChild: layer];
      
      HudLayer * hud = [HudLayer node];
      [scene addChild: hud];
      layer.hud = hud;
  / / Return the scene
  return scene;
  }
  
  - (id) init
  {
  if ((self = [super init])) {
  ...}
  </code></pre>
  
  <p>In HelloWorldLayer have a method that should be added to the layer CCSprite HelloWorldLayer</p>
  
  <pre><code>- (void) CreateSprite {
          CGSize winSize = [CCDirector sharedDirector]. WinSize;
          CCSprite * sprite = [CCSprite spriteWithFile: @ "bird.png"];
                      sprite.position = ccp (winSize.width / 2 , winSize.height / 2);
          [self addChild: sprite];
  }
  </code></pre>
  
  <p>In Hudlayer a button and a method that works when you press the</p>
  
  <pre><code>@ implementation HudLayer
  
  - (Id) init
  {
      self = [super init];
      if (self) {
                  CGSize size = [CCDirector sharedDirector]. WinSize;
         CCMenuItem * Button = [CCMenuItemImage
                      itemFromNormalImage: @ "1.png" selectedImage: @ "1.png" target: self selector: @ selector (Build :)];
          CCMenu * menu = [CCMenu menuWithItems: Button, nil];
          [menu alignItemsHorizontallyWithPadding: 20] ;
          [menu setPosition: ccp (-Button.contentSize.width / 2 + size.width, size.height- 100 ) ] ;
          [self addChild: menu];
  
      }
      return self;
      
  }
  - (void) create: (id) sender
  {
      HelloWorldLayer * create = [[HelloWorldLayer alloc] init];
      [create CreateSprite];
  }
  </code></pre>
  
  <p>Appears on the screen button , when clicked, the method should work HelloWorldLayer CreateSprite and the screen should be added Tstssprite . Method that works , but why is not the sprite is added , no error is displayed </p>