텍스트 출력예제 (SystemFont 사용)
c++
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 | #include "test74.hpp" #include "SimpleAudioEngine.h" USING_NS_CC; Scene* Test74::createScene() { auto scene = Scene::create(); auto layer = Test74::create(); scene->addChild(layer); return scene; } bool Test74::init() { if ( !Layer::init()) { return false; } //Label 사용 예제 //SystemFont : 내장되어 있는 ttf 파일 사용 //createWithSystemFont("텍스트" , "폰트이름" , "폰트크기") auto label = Label::createWithSystemFont("Hello World", "arial", 34); label->setPosition(Point(240,160)); this->addChild(label); return true; } | cs |
결과
'IT > - 프로그래밍' 카테고리의 다른 글
코코스 Cocos Label 영역, 위치, 폰트, 폰트크기, 정렬 지정 (0) | 2017.01.17 |
---|---|
안드로이드 Error:The number of method references in a .dex file cannot exceed 64. (0) | 2017.01.16 |
코코스 Cocos 기본 메서드 예제 (setOpacity , setScale , setRotation , setFlippedX) (0) | 2017.01.12 |
C/C++ Visual Studio 2015 설치하기 (0) | 2017.01.11 |
코코스 Cocos 기본 자료형 (Point , Size , Rect) 예제 (0) | 2017.01.10 |