本文整理汇总了C++中CCTextFieldTTF::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CCTextFieldTTF::setColor方法的具体用法?C++ CCTextFieldTTF::setColor怎么用?C++ CCTextFieldTTF::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCTextFieldTTF
的用法示例。
在下文中一共展示了CCTextFieldTTF::setColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool RegisterLayer::init()
{
bool result = false;
do {
CC_BREAK_IF(!TextInputDelegate::init());
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
// add background
CCSprite* background = CCSprite::spriteWithSpriteFrameName("email_background");
background->setPosition(CCPointMake(winSize.width * 0.5f, winSize.height * 0.5f));
CC_ASSERT(background);
addChild(background);
CCPoint emailTextFieldPos = CCPointMake(158.0f, 308.0f);
CCSprite* emailbg = CCSprite::spriteWithSpriteFrameName("textfield");
emailbg->setPosition(emailTextFieldPos);
addChild(emailbg,kZUILabel,kTagEmailBG);
CCTextFieldTTF* field = addTextField(emailTextFieldPos, kZUITextField,kTagEmail, "输入邮件地址登陆", "Thonburi", 14);
field->setColor(ccBLUE);
CCPoint nameTextFieldPos = CCPointMake(158.0f,221.0f);
CCSprite* namebg = CCSprite::spriteWithSpriteFrameName("textfield");
namebg->setPosition(nameTextFieldPos);
addChild(namebg,kZUILabel,kTagUsernameBG);
field = addTextField(nameTextFieldPos, kZUITextField, kTagUsername, "输入用户名(推荐)", "Thonburi", 14);
field->setColor(ccBLACK);
CCSprite* startbutton = CCSprite::spriteWithSpriteFrameName("email_start");
startbutton->setPosition(CCPointMake(160.0f, 180.0f));
addChild(startbutton,kZUILabel,kTagStartButton);
result = true;
} while (0);
return result;
}
示例2: creatPasswordText
void LogIntoLayer::creatPasswordText()
{
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCPoint pos = CCPointMake(winSize.width*220/500,winSize.height*22/50);
CCTextFieldTTF* text = CCTextFieldTTF::textFieldWithPlaceHolder(
"Input Your Password...","Arial",20);
text->setColor(ccc3(INPUT_R,INPUT_G,INPUT_B));
text->setPosition(pos);
this->addChild(text,20);
text->setDelegate(this);
text->retain();
passwordText = text;
}
示例3: creatUsernameText
void RegisterLayer::creatUsernameText()
{
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCPoint pos = CCPointMake(winSize.width*250/500,winSize.height*35/50);
CCTextFieldTTF* text = CCTextFieldTTF::textFieldWithPlaceHolder(
"Input Your Name...","Arial",20);
text->setColor(ccc3(INPUT_R,INPUT_G,INPUT_B));
text->setPosition(pos);
this->addChild(text,20);
text->setDelegate(this);
text->retain();
usernameText = text;
}