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


C++ CCLabelTTF::setRotation方法代码示例

本文整理汇总了C++中CCLabelTTF::setRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLabelTTF::setRotation方法的具体用法?C++ CCLabelTTF::setRotation怎么用?C++ CCLabelTTF::setRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCLabelTTF的用法示例。


在下文中一共展示了CCLabelTTF::setRotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createGoalLabelForPlayer

CCLabelTTF* BYGameScene::createGoalLabelForPlayer(BYGamePlayer player) {
    CCPoint         pos;
    float           rotation           = 0;
    
    CCSize winSize = CCDirector::sharedDirector()->getWinSize();
    pos.x = winSize.width / 2;
    if (player == BYGamePlayer_topPlayer) {
        pos.y = winSize.height * 3.0f / 4;
        rotation    = 180;
    } else {
        pos.y  = winSize.height / 4;
    }
    
    
    CCLabelTTF* lbl = CCLabelTTF::create("",
                                         "Marker Felt",
                                         40);
    lbl->setOpacity(0);
    lbl->setScale(BYGoalLabelScaleBy);
    lbl->setTag(GUI_GoalLabel);
    lbl->setPosition(pos);
    lbl->setRotation(rotation);
    
    return lbl;
}
开发者ID:myeyesareblind,项目名称:touchHockey,代码行数:25,代码来源:BYGameScene.cpp

示例2: initCircleContent

void GameLotteryLayer::initCircleContent()
{
	for(int i = 0; i < CIRCLE_CONTENT_COUNT; i++)
	{
		CCLabelTTF* ptrLbReward = CCLabelTTF::create(Utils::itoa(CircleContent[i]).c_str(), FontConstant::TTF_IMPACT, 18);
		ptrLbReward->setRotation(20 + 45 * i);
		m_ptrCircle->addChild(ptrLbReward, 1);
		ptrLbReward->setPosition(ccp(ChipAmountPositionOffsetX[i], ChipAmountPositionOffsetY[i]));
		m_ptrLbMutilply[i] = CCLabelTTF::create("", FontConstant::TTF_IMPACT, 18);
		//m_ptrLbMutilply[i]->setAnchorPoint(ccp(0, 0.5f));
		m_ptrLbMutilply[i]->setColor(ccc3(0,255,255));
		m_ptrLbMutilply[i]->setRotation(15.0f);
		ptrLbReward->addChild(m_ptrLbMutilply[i]);
		LayoutUtil::layoutParentRight(m_ptrLbMutilply[i], 20, -3);
	}
}
开发者ID:forappengine,项目名称:texasholdem,代码行数:16,代码来源:GameLotteryLayer.cpp

示例3: init

bool DailyDaysCompletePopup::init(uint32_t days, uint32_t reward)
{
    if (!CCLayer::init()) return false;
    
    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    
    CCSprite* back = CCSprite::create("Interfeiss/challenges/complete_popup/dont_leave.png");
    back->setPosition(ccp(visibleSize.width / 2, visibleSize.height / 2));
    addChild(back);
    
    
    CCMenuItemImage* closeBt = CCMenuItemImage::create("Interfeiss/level_end/level_up_popup/x_btn0001.png",
                                                       "Interfeiss/level_end/level_up_popup/x_btn0002.png",
                                                       this, menu_selector(DailyDaysCompletePopup::close));
    
    CCMenu* closeMenu = CCMenu::create(closeBt, NULL);
    closeMenu->setPosition(ccp(730, 530));
    addChild(closeMenu);
    
    CCMenuItemImage* shareBt =
    CCMenuItemImage::create("Interfeiss/challenges/complete_popup/share_btn_still0001.png",
                            "Interfeiss/challenges/complete_popup/share_btn_still0002.png",
                            this, menu_selector(DailyDaysCompletePopup::share));
    CCMenu* shareMenu = CCMenu::create(shareBt, NULL);
    shareMenu->setPositionY(200);
    shareMenu->setPositionX(visibleSize.width / 2 + 0);
    addChild(shareMenu);
    
    
    CCLabelTTF* titleTxt = CCLabelTTF::create(("Daily challenge completed " + toString(days) + " days in a row!").c_str(),
                                              FONT_SKRANJI_BOLD,
                                              TITLE_FONT_SIZE*0.6, CCSize(320, 180),
                                              kCCTextAlignmentCenter, kCCVerticalTextAlignmentTop);
    titleTxt->setColor(ccc3(0x3E, 0x16, 0x04));
    titleTxt->setRotation(-2);
    titleTxt->setPosition(ccp(visibleSize.width / 2+80, visibleSize.height / 2 + 70));
    addChild(titleTxt);
    
    // title
    CCLabelTTF* levelTxt = CCLabelTTF::create("reward", FONT_SKRANJI_BOLD,
                                              TITLE_FONT_SIZE*0.6, CCSize(130, 120),
                                              kCCTextAlignmentCenter, kCCVerticalTextAlignmentTop);
    levelTxt->setColor(ccc3(0x4F, 0x98, 0x8B));
    levelTxt->setRotation(-6);
    levelTxt->setPosition(ccp(visibleSize.width / 2 + 40, visibleSize.height / 2 - 70));
    addChild(levelTxt);
    
    // reward
    CCLabelTTF* rewardSh = CCLabelTTF::create(toString(reward).c_str(), FONT_SKRANJI_BOLD, TITLE_FONT_SIZE*1,
                                              CCSize(100, 55), kCCTextAlignmentRight, kCCVerticalTextAlignmentCenter);
    rewardSh->setAnchorPoint(ccp(0,0));
    rewardSh->cocos2d::CCNode::setPosition(ccp(580, 2));
    rewardSh->setColor(ccc3(0xff, 0xff, 0xff));
    rewardSh->enableShadow(CCSize(3,3), 0.5, 3, true);
    rewardSh->setRotation(-6);
    rewardSh->setPosition(ccp(visibleSize.width / 2 - 70, 245));
    addChild(rewardSh);
    
    CCLabelTTF* rewardT = CCLabelTTF::create(toString(reward).c_str(), FONT_SKRANJI_BOLD, TITLE_FONT_SIZE*1,
                                             CCSize(100, 55), kCCTextAlignmentRight, kCCVerticalTextAlignmentCenter);
	rewardT->setAnchorPoint(ccp(0,0));
	rewardT->setColor(ccc3(0xff, 0xff, 0xff));
	rewardT->cocos2d::CCNode::setPosition(ccp(580, 2));
    rewardT->setRotation(-6);
	rewardT->setPosition(ccp(visibleSize.width / 2 - 70, 245));
    addChild(rewardT);
    
    // animation
    TimedSpriteAnimation* check = TimedSpriteAnimation::create("Interfeiss/challenges/ingame_pop_up/check.plist", 3);
    check->setAnchorPoint(ccp(0, 1));
    check->setPosition(ccp(visibleSize.width / 2 + 190, 460));
    addChild(check);
    
    // icon
    char rewardStr[10];
    std::string iconStr;
    sprintf(rewardStr, "+%d", reward);
    
    iconStr = "Interfeiss/challenges/award_diamond.png";
    
    rewardSh->setString(rewardStr);
    rewardT->setString(rewardStr);
    
    // icon
	CCSprite* icon = CCSprite::create(iconStr.c_str());
	icon->setAnchorPoint(ccp(0.5,0.5));
    icon->setScale(0.8);
	icon->setPosition(ccp(visibleSize.width / 2 + 80, 280));
	addChild(icon);
    
    return true;
}
开发者ID:,项目名称:,代码行数:92,代码来源:


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