3
배경 이미지 repeat-x를 원하지만 이미지의 witdh 및 높이를 변경하고 싶지는 않습니다.cocos2d-x NPOT 이미지를 반복하는 방법
CCSize s = CCDirector::sharedDirector()->getWinSize();
CCSprite* sprite = CCSprite::create("sprite.png"); // the image size is 256 * 224, so the height is non power of 2.
CCRect spriteRect = sprite->getTextureRect();
spriteRect.size.width = s.width;
pSkyBg->setTextureRect(skyRect);
ccTexParams tp = { GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT};
sprite->getTexture()->setTexParameters(&tp);
sprite->setPosition((ccp(0, s.height)));
sprite->setAnchorPoint(ccp(0, 1));
addChild(sprite, 0);
약간 잘못되었습니다. 누가 날 도울 수 있죠! 감사!
우리가 GL_WRAP를 사용할 수 있습니까? – Pradeep