Page 1 of 1

PlanetCute Images

Posted: Wed Nov 25, 2015 6:54 am
by gOzaru
Hi, I am sorry for asking a question again.
I tested PlanetCute on Lumia 535 and I found out that the images which are used for all background and platform are jaggies. It is not antialiased and frame rate below 30 FPS.
In cocos2d-x 3.8 I have to use the power of two in all images I want to apply anti aliasing.
My question is can I apply antialias in all images exported through json file?
If so, how can I do it?
Should I import images with power of two in Rube scene before exporting it to json?
Or any other ideas?

Re: PlanetCute Images

Posted: Thu Nov 26, 2015 8:48 am
by iforce2d
I think this is a question for the cocos2d-x forums... are the images displaying correctly in RUBE?

Re: PlanetCute Images

Posted: Thu Nov 26, 2015 9:44 am
by gOzaru
I think I've just known how to solve it.
It is actually related to RUBELayer.cpp.

So at the beginning when we want to make rube scene, we have to import images which resolution has power of two. Then once we imported the json in cocos2d-x, we apply the antialising to sprite inside RUBELayer::afterLoadProcessing(b2Json *json) there.....

Code: Select all

Texture2D::TexParams params = { GL_LINEAR, GL_LINEAR, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE };
sprite->getTexture()->setTexParameters(params);
sprite->getTexture()->setAntiAliasTexParameters();
Edit:
It doesn't work.....
I think this question is related to Rube since the images are processed there.
The images are loaded but they are all jaggies.
I wonder where I got wrong....

Re: PlanetCute Images

Posted: Fri Nov 27, 2015 8:19 am
by iforce2d
How do you mean the images are processed in RUBE? The only thing RUBE does is output a text file (.json export). Anything that happens in your own program after loading the RUBE scene is handled by cocos2d-x features.

Re: PlanetCute Images

Posted: Fri Nov 27, 2015 9:24 am
by gOzaru
yup.
I was wrong.
Sorry. I should ask this in cocos2d-x forum.
Thank you.