本文整理汇总了C++中CAView::runAction方法的典型用法代码示例。如果您正苦于以下问题:C++ CAView::runAction方法的具体用法?C++ CAView::runAction怎么用?C++ CAView::runAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAView
的用法示例。
在下文中一共展示了CAView::runAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toast
void UtilManager::toast(string text, CAViewController* object) {
CAApplication::getApplication()->getRootWindow()->removeSubviewByTag(TOAST_VIEW_TAG);
CCSize winSize = CAApplication::getApplication()->getWinSize();
//CAView *back = CAView::createWithCenter(CCRect(winSize.width*0.5, winSize.height*0.5, _dip(winSize.width)*0.3, _dip(winSize.height)*0.3));
CAView *back = CAView::createWithCenter(CCRect(winSize.width*0.5, winSize.height*0.5, 180 * getScale(), 30 * getScale()));
back->setTag(TOAST_VIEW_TAG);
back->setColor(ccc4(31, 31, 31, 200));//40
CALabel *title = CALabel::createWithCenter(CADipRect(_dip(back->getBounds().size.width*0.5),
_dip(back->getBounds().size.height*0.5), 180 * getScale(), 30 * getScale()));
// title->setText(UTF8ToGBK::transferToGbk(text));
title->setText(text);
//title->setText("sssss");
// title->setFontName(getChineseFont());
title->setColor(CAColor_white);
title->setTextAlignment(CATextAlignmentCenter);
title->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
title->setFontSize(_px(15));
back->addSubview(title);
//CAApplication::getApplication()->getRootWindow()->getRootViewController()->getView()->addSubview(back);
back->runAction(CCFadeOut::create(1));
//CAApplication::getApplication()->getRootWindow()->addSubview(back);
object->getView()->addSubview(back);
//CCLog("%s", get_date_now().c_str());
scheduleOnce(schedule_selector(UtilManager::removeToast), this, TOAST_TIME);
}
示例2: presentModalViewController
void CAWindow::presentModalViewController(CAViewController* controller, bool animated)
{
CC_RETURN_IF(controller == NULL);
CC_RETURN_IF(m_pModalViewController);
CC_SAFE_RETAIN(controller);
m_pModalViewController = controller;
m_pModalViewController->addViewFromSuperview(this);
m_pModalViewController->getView()->setZOrder(CAWindowZoderCenter);
if (animated)
{
CAView* view = m_pModalViewController->getView();
CCRect frame = view->getFrame();
frame.origin.y = frame.size.height;
view->setFrame(frame);
CCRect endFrame = CCRectZero;
endFrame.size = view->getFrame().size;
CCCallFunc* start = CCCallFunc::create(this, callfunc_selector(CAWindow::presentStart));
CCCallFunc* end = CCCallFunc::create(this, callfunc_selector(CAWindow::presentEnd));
CCDelayTime* delayTime = CCDelayTime::create(0.1f);
CCFrameTo* frameTo = CCFrameTo::create(0.3f, endFrame);
CCEaseSineOut* easeBack = CCEaseSineOut::create(frameTo);
CCSequence* allActions = CCSequence::create(start, delayTime, easeBack, end, NULL);
view->runAction(allActions);
}
}
示例3: onEnter
void CCTransitionFade :: onEnter()
{
CCTransitionScene::onEnter();
CCSize size = CCDirector::sharedDirector()->getWinSize();
CAView* l = CAView::createWithFrame(CCRect(0, 0, size.width, size.height));
l->setColor(ccc3(m_tColor.r, m_tColor.g, m_tColor.b));
l->setOpacity(m_tColor.a);
m_pInScene->setVisible(false);
l->setTag(kSceneFade);
insertSubview(l, 2);
CAView* f = getSubviewByTag(kSceneFade);
CCActionInterval* a = (CCActionInterval *)CCSequence::create
(
CCFadeIn::create(m_fDuration/2),
CCCallFunc::create(this, callfunc_selector(CCTransitionScene::hideOutShowIn)),//CCCallFunc::create:self selector:@selector(hideOutShowIn)],
CCFadeOut::create(m_fDuration/2),
CCCallFunc::create(this, callfunc_selector(CCTransitionScene::finish)), //:self selector:@selector(finish)],
NULL
);
f->runAction(a);
}
示例4: dismissModalViewController
void CAWindow::dismissModalViewController(bool animated)
{
CC_RETURN_IF(m_pModalViewController == NULL);
if (animated)
{
CAView* view = m_pModalViewController->getView();
CCRect endFrame = view->getFrame();
endFrame.origin.y = endFrame.size.height;
CCCallFunc* start = CCCallFunc::create(this, callfunc_selector(CAWindow::dismissStart));
CCCallFunc* end = CCCallFunc::create(this, callfunc_selector(CAWindow::dismissEnd));
CCFrameTo* frameTo = CCFrameTo::create(0.3f, endFrame);
CCEaseSineIn* easeBack = CCEaseSineIn::create(frameTo);
CCSequence* allActions = CCSequence::create(start, easeBack, end, NULL);
view->runAction(allActions);
}
else
{
this->dismissEnd();
}
}