本文整理汇总了C++中CAScale9ImageView::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ CAScale9ImageView::copy方法的具体用法?C++ CAScale9ImageView::copy怎么用?C++ CAScale9ImageView::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAScale9ImageView
的用法示例。
在下文中一共展示了CAScale9ImageView::copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
void CATextToolBarView::show(CAView* pView)
{
CCSize winSize = CAApplication::getApplication()->getWinSize();
float alertViewButtonHeight = 88;
float alertViewWidth = winSize.width * 2 / 3;
CCRect rect = CCRect(winSize.width / 2, winSize.height / 2 - alertViewButtonHeight, alertViewWidth, alertViewButtonHeight);
m_pBackView = CAClippingView::create();
m_pBackView->setCenter(rect);
this->addSubview(m_pBackView);
this->setTextTag("CATextToolBarView");
m_pBackView->setAlphaThreshold(0.5f);
CAScale9ImageView *backgroundImageView = CAScale9ImageView::createWithFrame(m_pBackView->getBounds());
backgroundImageView->setImage(CAImage::create("source_material/alert_back.png"));
m_pBackView->addSubview(backgroundImageView);
m_pBackView->setStencil(backgroundImageView->copy());
size_t btnCount = m_CallbackTargets.size();
for (int i = 0; i < btnCount; i++)
{
CAButton* btn = CAButton::create(CAButtonTypeSquareRect);
btn->setTitleForState(CAControlStateAll, m_CallbackTargets[i].cszButtonText.c_str());
btn->setTitleColorForState(CAControlStateAll, ccc4(3, 100, 255, 255));
btn->setBackGroundViewForState(CAControlStateNormal, CAView::createWithColor(CAColor_clear));
btn->setBackGroundViewForState(CAControlStateHighlighted, CAView::createWithColor(ccc4(226, 226, 226, 225)));
btn->setTag(i);
btn->addTarget(this, CAControl_selector(CATextToolBarView::alertViewCallback), CAControlEventTouchUpInSide);
btn->setFrame(CCRect(i*alertViewWidth / btnCount, 0, alertViewWidth / btnCount, alertViewButtonHeight));
m_pBackView->addSubview(btn);
if (i>0)
{
addGrayLine(alertViewWidth/btnCount * i);
}
}
if (CAWindow *rootWindow = CAApplication::getApplication()->getRootWindow())
{
rootWindow->insertSubview(this, CAWindowZOderTop);
}
becomeFirstResponder();
m_pControlView = pView;
}