cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.1k stars 7.05k forks source link

CCLabel enableOutline shift on Android Cocos2d-x 3.3beta0 #8583

Closed ahlwong closed 9 years ago

ahlwong commented 9 years ago

EDIT: After looking into the problem further I was able to replicate the issue on iOS too. The issue is related to TTFConfig fonts vs SystemFonts. I was loading fonts by the font name on iOS and by their resource path on Android. When I switched to loading Fonts by their resource path on iOS, I encountered the same issue.

Either way, the issue is that when you enableOutline on a TTFConfig font, the text is rendered in a higher position. It should render in-place.

ORIGINAL: On Android when you enableOutline on a CCLabel it causes the text to shift positions up. (Tested on multiple Android devices)

It looks as though the text is positioned so that the anchor is BOTTOM even though it reads and is set as MIDDLE. The shift does not occur on iOS devices. screen

minggo commented 9 years ago

@Dhilan007 Could you please take a look?

WenhaiLin commented 9 years ago

Fixed at https://github.com/cocos2d/cocos2d-x/pull/8904

ahlwong commented 9 years ago

Fixed!

mirth commented 9 years ago

It have occurred for me on 3.6. It also happens in Cocos Studio (2.3.2 Beta). outline What is more it only occures when outline size is >1.

WenhaiLin commented 9 years ago

@mirth Please try fix it by apply this pr:https://github.com/cocos2d/cocos2d-x/pull/11720

mirth commented 9 years ago

Unfortunately it didn't help.

mirth commented 9 years ago

Resolved by increasing the label node content size.