I am struggling with a really strange problem: I have 2 sprites where each sprite has a TTF label als child. I create both labels in the exact same way:
Label* lblMainMenu = Label::createWithTTF(ttfConfig, "Main menu"); lblMainMenu->setColor( g_menuLabelColor ); lblMainMenu->setPosition( Vec2(buttonSize.width / 2 + 0.5f, buttonSize.height / 2 + 0.5f) ); btnMainMenu->addChild(lblMainMenu); // Second label Label* lblSelectLevel = Label::createWithTTF(ttfConfig, "Main level"); lblSelectLevel->setColor( g_menuLabelColor ); lblSelectLevel->setPosition( Vec2(buttonSize.width / 2 + 0.5f, buttonSize.height / 2 + 0.5f) ); btnSelectLevel->addChild(lblSelectLevel);
The problem is: The first label “Main menu” is rendered with sharp edges, but the second label “Main level” is much more blurry! I made a screenshot (zoomed in) to show the effect:
Just look at the word “Main”. The top one is much more blurry. It is especially noticable at vertical lines. The vertical lines of the “M” at the bottom are straight lines, while the verticles lines of the top “M” are blurred.
As you can see in my code I tried to play around with 0.5f offsets onto the position, because (strangely enough) this 0.5f offset makes the bottom label sharp. Even though the top label ALSO gets a 0.5f offset (the world space coordiantes of both labels has a .5 fraction; it is not a clamped integer) it is blurry!
Anyone knows this effect and has an idea how I can make my labels sharp?