当前位置: 首页>>代码示例>>C++>>正文


C++ CCTextFieldTTF::setColor方法代码示例

本文整理汇总了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;
}
开发者ID:flywingsky,项目名称:drawstory_client,代码行数:40,代码来源:RegisterLayer.cpp

示例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;
}
开发者ID:cruisehu,项目名称:PongPongPia,代码行数:14,代码来源:LogIntoLayer.cpp

示例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;
	
}
开发者ID:cruisehu,项目名称:PongPongPia,代码行数:16,代码来源:RegisterLayer.cpp


注:本文中的CCTextFieldTTF::setColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。