Label的使用

来源:互联网 发布:淘宝中差评修改步骤 编辑:程序博客网 时间:2024/06/09 15:01

1Label中的使用createWithCharMap(加入图片字符为0123456789x

    1、使用.png创建

    //create 字符图片.png,每个字符宽,高,起始字符

    Label* lb4 = Label::createWithCharMap(fonts/digit.png, 20, 20,0);

lb4->setString(123456); //设置字符串内容

//注意如果要用x字符,需要找到9后面对应的字符

Lb4->setString(StringUtils::format(":%d",3));//显示x3:字符为9后面asscii对应的字符

this->addChild(lb4 );

原创粉丝点击