本文整理汇总了C++中CCMenu::setRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ CCMenu::setRotation方法的具体用法?C++ CCMenu::setRotation怎么用?C++ CCMenu::setRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCMenu
的用法示例。
在下文中一共展示了CCMenu::setRotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadUI
void BYGameScene::loadUI() {
CCSpriteFrameCache *frameCache = CCSpriteFrameCache::sharedSpriteFrameCache();
frameCache->addSpriteFramesWithFile("ui.plist", "ui.png");
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
/// pause button
CCSprite* btnNormalSprite = CCSprite::createWithSpriteFrameName("pause.png");
CCMenuItemSprite *pauseMenuItem = CCMenuItemSprite::create(btnNormalSprite,
btnNormalSprite,
this,
menu_selector(BYGameScene::pauseButtonHandler));
/// 2 labels for goals
ccColor3B color = ccc3(220, 70, 20); /// red color
_labelBotPlayerGoalsScored = CCLabelTTF::create("0", "Marker Felt", 40);
_labelBotPlayerGoalsScored->setColor(color);
CCMenuItemLabel *labelBot = CCMenuItemLabel::create(_labelBotPlayerGoalsScored, NULL, NULL);
labelBot->setEnabled(false);
_labelTopPlayerGoalsScored = CCLabelTTF::create("0", "Marker Felt", 40);
_labelTopPlayerGoalsScored->setColor(color);
CCMenuItemLabel *labelTop = CCMenuItemLabel::create(_labelTopPlayerGoalsScored, NULL, NULL);
labelTop->setEnabled(false);
/// CCMenu doesnt support anchorPoint as of 0x00020003 version
CCMenu *menu = CCMenu::create(labelTop, pauseMenuItem, labelBot, NULL);
menu->alignItemsHorizontallyWithPadding(5);
menu->setAnchorPoint(CCPointMake(0, 0));
menu->setPosition(CCPointMake(winSize.width - pauseMenuItem->getContentSize().width / 2,
winSize.height / 2));
menu->setRotation(90);
this->addChild(menu);
}