외부 TTF Fonts 사용하기
Resources > fonts 폴더에 ttf 파일 추가
ios > Icons > Info.plist
Fonts provided by application 에 fonts/폰트파일명 추가하기
c++)
내장폰트 쓰는 방법과 똑같이 createWithSystemFont() 함수 사용
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #include "test79.hpp" USING_NS_CC; Scene* Test79::createScene() { auto scene = Scene::create(); auto layer = Test79::create(); scene->addChild(layer); return scene; } bool Test79::init() { if ( !Layer::init()) { return false; } //createWithSystemFont(글자,폰트,폰트크기,라벨크기,가로정렬,세로정렬) //내장 폰트 쓰는 법과 같다 auto label = Label::createWithSystemFont("Hello World, Fonts : TTF", "A Damn Mess", 24, Size(200, 150), TextHAlignment::CENTER, TextVAlignment::CENTER); label->setPosition(Point(100, 100)); this->addChild(label); return true; } | cs |
결과
'IT > - 프로그래밍' 카테고리의 다른 글
코코스 CharMap 폰트 사용하기 (0) | 2017.01.23 |
---|---|
코코스 BMFont 사용하기 (0) | 2017.01.20 |
안드로이드 갤러리에서 이미지 여러개 선택하여 이미지뷰에 보이기 (1) | 2017.01.18 |
코코스 Cocos Label 영역, 위치, 폰트, 폰트크기, 정렬 지정 (0) | 2017.01.17 |
안드로이드 Error:The number of method references in a .dex file cannot exceed 64. (0) | 2017.01.16 |