本文整理汇总了C++中CAImageView::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CAImageView::setColor方法的具体用法?C++ CAImageView::setColor怎么用?C++ CAImageView::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAImageView
的用法示例。
在下文中一共展示了CAImageView::setColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
void CAPageControl::onEnter()
{
CAControl::onEnter();
if (m_pIndicators.size() != m_numberOfPages) {
m_pIndicators.clear();
for (int i=0; i<m_numberOfPages; i++) {
CAImageView* view;
if (i == m_currentPage) {
view = CAImageView::createWithImage(m_pSelectPageImage);
view->setColor(m_currentPageIndicatorTintColor);
} else {
view = CAImageView::createWithImage(m_pPageImage);
view->setColor(m_pageIndicatorTintColor);
}
CCRect rect;
float width = getFrame().size.width/m_numberOfPages;
rect.origin.x = i * width + width/2;
rect.origin.y = getFrame().size.height/2;
view->setCenterOrigin(rect.origin);
addSubview(view);
m_pIndicators.pushBack(view);
}
}
}
示例2: updateCurrentPageDisplay
void CAPageControl::updateCurrentPageDisplay()
{
for (int i=0; i<m_numberOfPages; i++) {
CAImageView* view = m_pIndicators.at(i);
if (i == m_currentPage) {
view->setImage(m_pSelectPageImage);
view->setColor(m_currentPageIndicatorTintColor);
} else {
view->setImage(m_pPageImage);
view->setColor(m_pageIndicatorTintColor);
}
}
updateDraw();
}
示例3: copy
CAView* CAImageView::copy()
{
CAImageView* pReturn = CAImageView::create();
if (m_bFrame)
{
pReturn->setFrame(this->getFrame());
}
else
{
pReturn->setCenter(this->getCenter());
}
pReturn->setImageViewScaleType(this->getImageViewScaleType());
pReturn->setImage(this->getImage());
pReturn->setColor(this->getColor());
return pReturn;
}
示例4: onEnterTransitionDidFinish
void CAButton::onEnterTransitionDidFinish()
{
CAView::onEnterTransitionDidFinish();
if (this->CAControl::getBackGroundView() == NULL)
{
this->setBackGroundDefault();
}
if (this->getHighlightedBackGroundView() == NULL)
{
if (CCScale9Sprite* bg = dynamic_cast<CCScale9Sprite*>(this->CAControl::getBackGroundView()))
{
CCScale9Sprite* bgHighLighted = CCScale9Sprite::createWithImage(bg->getImage());
bgHighLighted->setPreferredSize(bg->getPreferredSize());
bgHighLighted->setColor(ccc3(127, 127, 127));
this->setBackGround(CAControlStateHighlighted, bgHighLighted);
}
else if (CAImageView* bg = dynamic_cast<CAImageView*>(this->CAControl::getBackGroundView()))
{
CAImageView* bgHighLighted = CAImageView::createWithImage(bg->getImage());
bgHighLighted->setBounds(bg->getBounds());
bgHighLighted->setColor(ccc3(127, 127, 127));
this->setBackGround(CAControlStateHighlighted, bgHighLighted);
}
else if (CAView* bg = dynamic_cast<CAView*>(this->CAControl::getBackGroundView()))
{
CAView* bgHighLighted = CAView::createWithFrame(bg->getFrame());
bgHighLighted->setColor(ccc3(bg->getColor().r/2, bg->getColor().g/2, bg->getColor().b/2));
this->setBackGround(CAControlStateHighlighted, bgHighLighted);
}
}
this->updateWithPoint();
this->setControlStateNormal();
}