cocos2d-js怎么实现图片平铺背景?

网上搜索到 cocos2d-x 是这么写的,大神帮我翻译过来吧!实在是看不懂!

Texture2D *texture = Director::getInstance() -> getTextureCache() -> addImage(“Santa.png”);
Texture2D::TexParams tp = {GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT};
texture -> setTexParameters(tp);
auto sprite = Sprite::createWithTexture(texture, Rect(0 , 0, visibleSize.width, visibleSize.height));
sprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
this->addChild(sprite, 0);

同一问题,发一个贴子就可以了。
有问题可以先搜索论坛。

http://www.cocoachina.com/bbs/read.php?tid=219419

希望这个贴子可以帮到你。