title: SpriteKit: How to draw a board of squares using SKSpriteNode with texture to be resolution independent?
body: <p>I'm trying to draw a board of squares using SKSpriteNode using a texture. The board must have different various sizes (8x8, 12x15, etc.). This must be draw correctly independent of the device resolution. Figured the way in which to create the board, but the textures are not drawn correctly. Below is the code that loads the grid:</p>
  
  <pre><code>for (int y = 0; y &lt; self.boardHeight; y++) {
      for (int x = 0; x &lt; self.boardWidth; x++) {
          SKSpriteNode *squareNode = [[SKSpriteNode alloc] initWithTexture:_textureSquare];
          CGPoint squareCoordinate = CGPointMake(x, y);
          squareNode.position = [_squareSystemCoord tileCenter:squareCoordinate];
          squareNode.texture = _textureNormal;
          [self addChild:squareNode];
      }
  }
  </code></pre>
  
  <p>_squareSystemCoord converts from square grid coords (i.e. (0,1), (1,2), etc) to SpriteKit coords system.</p>
  
  <p>Due to the fact that SKSpriteNode takes the dimensions of the texture, the squares are drawn apart from each other on bigger resolutions. </p>
  
  <p>Is there a way to draw a board of SKSpriteNode with texture to be resolution independent?</p>
  
  <p>Thank you!</p>