本文整理汇总了C++中CImageView::setScale方法的典型用法代码示例。如果您正苦于以下问题:C++ CImageView::setScale方法的具体用法?C++ CImageView::setScale怎么用?C++ CImageView::setScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImageView
的用法示例。
在下文中一共展示了CImageView::setScale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CImageView *TuiManager::createImage(float tag, const char* file, float scaleX, float scaleY,float x, float y, float rotation){
CImageView *pImg = m_isUseSpriteFrame ? CImageView::createWithSpriteFrameName(file) : CImageView::create(file);
Size size = pImg->getContentSize();
pImg->setPosition(Point(x,-y));
pImg->setScale(scaleX, scaleY);
pImg->setRotation(rotation);
pImg->setTag(tag);
return pImg;
}
示例2:
CImageView *TuiManager::createImage(float tag, const char* file, float scaleX, float scaleY, int flipX, int flipY, float x, float y, float rotation, int isUseFrame){
CImageView *pImg = isUseFrame ? CImageView::createWithSpriteFrameName(file) : CImageView::create(file);
Size size = pImg->getContentSize();
pImg->setPosition(Vec2(x,-y));
pImg->setFlippedX(flipX == 1);
pImg->setFlippedY(flipY == 1);
pImg->setScale(scaleX, scaleY);
pImg->setRotation(rotation);
pImg->setTag(tag);
return pImg;
}
示例3: onEnter
void CSmeltArmor::onEnter()
{
BaseLayer::onEnter();
//四个选择框
for (unsigned int i=0; i<4; ++i)
{
CCheckBox *checkBtn = (CCheckBox*)(m_pBaseInfo[i]->findWidgetById("check"));
checkBtn->setOnCheckListener(this,ccw_check_selector(CSmeltArmor::onCheckAttr));
}
//选择武器
CButton *select = (CButton*)(m_ui->findWidgetById("select"));
select->setOnClickListener(this, ccw_click_selector(CSmeltArmor::onSelectItem));
//洗练
CButton *refine = (CButton*)(m_ui->findWidgetById("refine"));
refine->setOnClickListener(this, ccw_click_selector(CSmeltArmor::onRefineItem));
//初始化火
initFire();
//旋转圈
CImageView *circleFire = (CImageView*)(m_ui->findWidgetById("fire_circle"));
circleFire->setScale(1.95f);
circleFire->runAction(CCRepeatForever::create(CCRotateBy::create(1.0f, 60)));
circleFire->runAction(CCRepeatForever::create(CCSequence::createWithTwoActions(CCScaleTo::create(1.2f, 2.1f), CCScaleTo::create(1.2f, 1.95f))));
GetTcpNet->registerMsgHandler(SmeltArmorMsg,this,CMsgHandler_selector(CSmeltArmor::proceesMessage));
GetTcpNet->registerMsgHandler(SmeltDataRequestMsg,this,CMsgHandler_selector(CSmeltArmor::proceesMessage));
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_HERO, this, GameMsghandler_selector(CSmeltArmor::roleUpdate));
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_ITEM_DATA, this, GameMsghandler_selector(CSmeltArmor::updateStar));
}