Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cocos2d-x Design Size feature and blurry CCLabelTTF

I had a project with CCLabelTTF looking sharp and good. When I started to use the design size feature to fix some issues appeared with different device sizes, and retina displays, all fonts started to look blurry.

I saw an answer in the following link but it is complicated and I did not understand how to implement. http://www.cocos2d-x.org/forums/6/topics/32206?r=42107

Of course I can revert from using the design size feature, but I would prefer to use a workaround if there is one.

Thanks for advance.

like image 306
Abdalla Avatar asked Jan 05 '14 11:01

Abdalla


1 Answers

I added a workaround at the page you linked to, repeating it here:

A simple hack, create your label with the font at x4 size (or more/less if you want) and then scale the label to 0.25 (divide by 4) to get it back to its normal size. See my screenshot for the before and after results.

myLabel = CCLabelTTF::create("Play", "Helvetica", 20*4, CCSizeMake(0, 0), kCCTextAlignmentCenter);
myLabel->setScale(0.25);

Before and after fonts on buttons in Arrow Mania

like image 125
Gavin Thornton Avatar answered Oct 02 '22 03:10

Gavin Thornton