title: Set screen position to center of screen
body: <p>I am using a tile based game and also used a joystick. Using joystick sprite body move perfectly but tile map can not scroll.</p>
  
  <pre><code>-(void)setCenterOfScreen:(b2Vec2)position
  {
      int x=MAX(position.x*PTM_RATIO, size.width/2);
      int y=MAX(position.y*PTM_RATIO, size.height/2);
  
  
      int x1=MIN(x, (theMap.mapSize.width * theMap.tileSize.width-size.width/2));
      int y1=MIN(y, (theMap.mapSize.height * theMap.tileSize.height-size.height/2));
  
  
      b2Vec2 goodpoint=b2Vec2(x1,y1);
      NSLog(@"GoodPoint X: %f",goodpoint.x);
      NSLog(@"GoodPoint Y: %f",goodpoint.y);
  
  
      b2Vec2 differ=b2Vec2((size.width/2-goodpoint.x),(size.height/2-goodpoint.y));
      position=differ;
  }
  </code></pre>
  
  <p>Is it true logic?
  Please help me</p>
  
  <p>Thanks in advance</p>