その先にあるもの…

cocos2d-x bmpFont kerning 본문

프로그래밍/cocos2d

cocos2d-x bmpFont kerning

specialJ 2013. 7. 12. 15:16

cocos에서 문자 출력하는 방법으로 bmpFont가 있다.

fnt파일을 읽어 이름이 매칭된 그림 파일을 읽어 글자리를 렌더링 해주는데.

글자 사이의 길이 조절을 해주는 것이 kerning이라는 것이다.

angelcode의 폰트 도움말을 보면

kerning

The kerning information is used to adjust the distance between certain characters, e.g. some characters should be placed closer to each other than others.

first
The first character id.

second
The second character id.

amount
How much the x position should be adjusted when drawing the second character immediately following the first.

예제 샘플 markerFelt.fnt 파일을 열어

kernings count=3669
                      …
kerning first=49 second=50 amount=-3
을 수정해서 출력해보면

1과 2번의 글자 간격이 다른 것을 볼 수 있다.

'프로그래밍 > cocos2d' 카테고리의 다른 글

cocos cache 삭제  (0) 2013.06.19
cocos2d-x 메모리 관리  (0) 2013.06.19
임의의 점을 중심으로 한 sprite회전  (0) 2013.06.17
Comments