IT/- 프로그래밍
코코스 Cocos Label 영역, 위치, 폰트, 폰트크기, 정렬 지정
혁준7519
2017. 1. 17. 08:53
Cocos Label 영역, 위치, 폰트, 폰트크기, 정렬 지정
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 | #include "test76.hpp" USING_NS_CC; Scene* Test76::createScene() { auto scene = Scene::create(); auto layer = Test76::create(); scene->addChild(layer); return scene; } bool Test76::init() { if ( !Layer::init()) { return false; } //createWithSystemFont(글자,폰트,폰트크기,라벨크기,가로정렬,세로정렬) auto label = Label::createWithSystemFont("Hello World", "Dotum", 24, Size(100, 300), TextHAlignment::LEFT, TextVAlignment::CENTER); //label->setPosition() : 라벨의 위치지정 label->setPosition(Point(100, 100)); this->addChild(label); return true; } | cs |
결과