coco2d-x开发之文字的设置

来源:互联网 发布:阿里云网站建设教程 编辑:程序博客网 时间:2024/05/22 18:16

颜色的介绍


一、ccColor3B//ccColor3B predefined colors//! White color (255,255,255)static const ccColor3B ccWHITE={255,255,255};//! Yellow color (255,255,0)static const ccColor3B ccYELLOW={255,255,0};//! Blue color (0,0,255)static const ccColor3B ccBLUE={0,0,255};//! Green Color (0,255,0)static const ccColor3B ccGREEN={0,255,0};//! Red Color (255,0,0,)static const ccColor3B ccRED={255,0,0};//! Magenta Color (255,0,255)static const ccColor3B ccMAGENTA={255,0,255};//! Black Color (0,0,0)static const ccColor3B ccBLACK={0,0,0};//! Orange Color (255,127,0)static const ccColor3B ccORANGE={255,127,0};//! Gray Color (166,166,166)static const ccColor3B ccGRAY={166,166,166};


颜色的设置
//  设置文字效果 2013-09-24CCLabelTTF *wenzi = CCLabelTTF::create("Fuck ! Ship !","Tonburi",34);// 构造一个颜色ccColor3B color;color.r = 255;color.g = 0;color.b = 0;// 设置字体颜色wenzi->setColor(color);// 设置文字的透明度wenzi->setOpacity(100);// 设置文字的位置wenzi->setPosition(ccp(winSize.width / 2,winSize.height / 1.5));this->addChild(wenzi,1);


原创粉丝点击