Hi,
i am creating my first game using Cocos2d-x (I run it on Windows Phone 8.1)
I have a problem with texture coordinates of my sprites.
i have created an atlas for all of my textures (one .png file). Several different sprites use the same .png files but using different part of my .png file.
Each tiles texture of my atlas are very close (no space between tile texture part).
When i run my game on my lumia 640, it seems that some texture coordinates of my sprites are not exactly true.
if my texture tile is 32x32, it seems that cocos2d-x takes 33x32 pixels in the atlas.
i use:
m_frame = SpriteFrame::createWithTexture(texGameArea,Rect(0, 0, 32, 32));
To prevent linear filter artifacts, i use setAliasTexParameters:
auto texGameArea = Director::getInstance()->getTextureCache()->addImage("gamearea2.png");
texGameArea->setAliasTexParameters();
Note: My game use a resolution of 960 x 540 and my phone resolution is 1280 x 720.
Here is my AppDelegate code:
auto glview = director->getOpenGLView();
if(!glview)
{
glview = GLViewImpl::create("Push Or Die !");
glview->setFrameSize(960, 540);
glview->setDesignResolutionSize(960, 540, ResolutionPolicy::SHOW_ALL);
director->setOpenGLView(glview);
}
How can i solve my problem ?
Thanks.