본문 바로가기

카테고리 없음

[cocos2d-x]Chapter2-4. HelloWorldScene 문자출력

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
#include "HelloWorldScene.h"
 
Scene* HelloWorld::createScene()
{
    auto scene = Scene::create();
 
    auto layer = HelloWorld::create();
    scene->addChild(layer);
 
    return scene;
}
 
bool HelloWorld::init()
{
    if ( !Layer::init() )
    {
        return false;
    }
 
    //auto label = Label::createWithSystemFont("Hello World", "Thonburi", 34);
    auto label = Label::createWithSystemFont("Hell Cocos2d-x""Thonburi"50);
    label->setPosition(Point(240160));
    this->addChild(label);
 
    return true;
}
cs

 


원본 실행 결과

 

 


문구와 글자크기 조절