@jumpman8947 wrote:
I'm trying to create a chess board, and place it in the middle of the screen, so far i cannot get it to be directly in the center. i don't want to hard code the position to the screen because i'm going to be dealing with different screen sizes.
var winsize = cc.director.getWinSize(); var centerpos = cc.p(winsize.width / 2, winsize.height / 2); for (i=0; i<64; i++){ var tile = cc.Sprite.create(res.tile_png); this.addChild(tile,0); tile.setPosition(winsize.width+i%8*50/-10, winsize.height-Math.floor(i/8)*50); }
But the tiles and positioning is completely off
Posts: 3
Participants: 2