fenr9

导航

创建有规律的图形摆放

创建有规律的元素位置

for(var k=0;k<6;k++) {
this.boxsprite[k] = new Array();
for (var j = 0; j < 4; j++) {

this.boxsprite[k][j] = new DisboxSprite(res.Box01_png);
this.boxsprite[k][j].attr({
x: size.width / 2 - 325 + 130 * k,
y: size.height / 2 - 200 + 130 * j


});
this.addChild(this.boxsprite[k][j], 1);
this.dipan = new cc.Sprite(res.Dipan_png);
this.dipan.attr({
x:this.boxsprite[k][j].x,
y:this.boxsprite[k][j].y-50
});
this.addChild(this.dipan, 0);
}
}

 

posted on 2016-02-01 14:46  fenr9  阅读(351)  评论(0编辑  收藏  举报