Hi, i need some solution to one thing. Lets say i have an box2d object with 90*90 dimensions and i have a picture “pic.png”, that is of 30*30 dimensions. I initialize it this way:
And of course that picture doesn’t fill the whole rect. So, do you have any thought/if it’s possible to repeat that texture to fill whole rect? Thank you.
Alex Zhd, just realized that you were also right, GL_REPEAT repeats nicely only those texture, which has dimensions of 16x16, 32x32, 64x64 etc. Is there any way to repeat nicely e.g. 100x10 texture?
As far as I can tell there is no way to repeat a NPOT texture, it is an OpenGL ES constraint. If you have a repeatable texture it should be easy to stitch your 100x10 image into a power of two image using photoshop then use that image for repeating.
Hi, i need some solution to one thing. Lets say i have an box2d object with 90*90 dimensions and i have a picture “pic.png”, that is of 30*30 dimensions. I initialize it this way:
> CCSprite *sprite = CCSprite::spriteWithFile("pic.png", CCRectMake(0, 0, 90, 90));
>
And of course that picture doesn’t fill the whole rect. So, do you have any thought/if it’s possible to repeat that texture to fill whole rect? Thank you.
I ran across this pesky GL_REPEAT problem in my Cocos2d-iPhone project and made a little handy generalized tiling class that should be no trouble to port to Cocos2d-x: