Text的使用

来源:互联网 发布:2017淘宝装修教程 编辑:程序博客网 时间:2024/06/10 01:54

    ①// 使用系统字体创建一个Text

    auto text1 = Text::create("HelloWorld", "Arial", 48);

    text1->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2+100));

    this->addChild(text1);

    ②// 使用ttf文件创建一个字体

    auto text2 = Text::create("HelloWorld", "Marker Felt.ttf", 48);

    text2->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2-100));

this->addChild(text2);

原创粉丝点击