本文整理汇总了C++中CCRGBAProtocol::setOpacity方法的典型用法代码示例。如果您正苦于以下问题:C++ CCRGBAProtocol::setOpacity方法的具体用法?C++ CCRGBAProtocol::setOpacity怎么用?C++ CCRGBAProtocol::setOpacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCRGBAProtocol
的用法示例。
在下文中一共展示了CCRGBAProtocol::setOpacity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setOpacity
void UIWidget::setOpacity(int opacity)
{
CCRGBAProtocol* rgbap = DYNAMIC_CAST_CCRGBAPROTOCOL;
if (rgbap)
{
rgbap->setOpacity(opacity);
}
}
示例2: updateBackGroundImageOpacity
void Layout::updateBackGroundImageOpacity()
{
CCRGBAProtocol* rgba = dynamic_cast<CCRGBAProtocol*>(_backGroundImage);
if (rgba)
{
rgba->setOpacity(_backGroundImageOpacity);
}
}
示例3: FadeOutRecursively
//--------------------------------------------------------------------
// 递归渐隐
void FKCW_Action_TreeFadeOut::FadeOutRecursively( CCNode* p_pRoot, float p_fTime )
{
CCRGBAProtocol* p = dynamic_cast<CCRGBAProtocol*>(p_pRoot);
if(p)
{
p->setOpacity((GLubyte)(255 * (1 - p_fTime)));
}
CCArray* children = p_pRoot->getChildren();
int cc = p_pRoot->getChildrenCount();
for(int i = 0; i < cc; i++)
{
CCNode* child = (CCNode*)children->objectAtIndex(i);
if(!m_vecExcludeList.containsObject(child))
{
FadeOutRecursively(child, p_fTime);
}
else if(!m_bIsRecursivelyExclude)
{
FadeOutRecursively(child, p_fTime);
}
}
// 检查UI
Widget* w = dynamic_cast<Widget*>(p_pRoot);
if(w)
{
if(w->getVirtualRenderer())
{
CCRGBAProtocol* p = dynamic_cast<CCRGBAProtocol*>(w->getVirtualRenderer());
if(p)
{
p->setOpacity((GLubyte)(255 * (1 - p_fTime)));
}
}
CCArray* children = w->getNodes();
int cc = children->count();
for(int i = 0; i < cc; i++)
{
CCNode* child = (CCNode*)children->objectAtIndex(i);
FadeOutRecursively(child, p_fTime);
}
}
}
示例4: update
void CCFadeIn::update(ccTime time)
{
CCRGBAProtocol *pRGBAProtocol = m_pTarget->convertToRGBAProtocol();
if (pRGBAProtocol)
{
pRGBAProtocol->setOpacity((GLubyte)(255 * time));
}
/*m_pTarget->setOpacity((GLubyte)(255 * time));*/
}
示例5: update
void CCFadeOut::update(ccTime time)
{
CCRGBAProtocol *pRGBAProtocol = dynamic_cast<CCRGBAProtocol*>(m_pTarget);
if (pRGBAProtocol)
{
pRGBAProtocol->setOpacity(CCubyte(255 * (1 - time)));
}
/*m_pTarget->setOpacity(CCubyte(255 * (1 - time)));*/
}
示例6: update
void CCFadeTo::update(cocos2d::ccTime time)
{
CCRGBAProtocol *pRGBAProtocol = m_pTarget->convertToRGBAProtocol();
if (pRGBAProtocol)
{
pRGBAProtocol->setOpacity((GLubyte)(m_fromOpacity + (m_toOpacity - m_fromOpacity) * time));
}
/*m_pTarget->setOpacity((GLubyte)(m_fromOpacity + (m_toOpacity - m_fromOpacity) * time));*/
}
示例7: update
void CCFadeIn::update(ccTime time)
{
CCRGBAProtocol *pRGBAProtocol = dynamic_cast<CCRGBAProtocol*>(m_pTarget);
if (pRGBAProtocol)
{
pRGBAProtocol->setOpacity((GLubyte)(255 * time));
}
/*m_pTarget->setOpacity((GLubyte)(255 * time));*/
}
示例8: addChild
void GUINodeRGBA::addChild(cocos2d::CCNode *child)
{
CCNode::addChild(child);
CCRGBAProtocol *item = dynamic_cast<CCRGBAProtocol*>(child);
if (item)
{
item->setColor(this->getColor());
item->setOpacity(this->getOpacity());
}
}
示例9: setOpacity
void UILayout::setOpacity(int opacity)
{
UIWidget::setOpacity(opacity);
if (m_pBackGroundImage)
{
CCRGBAProtocol* rgbap = dynamic_cast<CCRGBAProtocol*>(m_pBackGroundImage);
if (rgbap)
{
rgbap->setOpacity(opacity);
}
}
}
示例10: setOpacity
void CCSpecialSprite::setOpacity(GLubyte opacity)
{
CCSprite::setOpacity(opacity);
Vector<CCNode *>::const_iterator beg = _children.begin();
Vector<CCNode *>::const_iterator end = _children.end();
for (; beg != end; ++beg)
{
CCRGBAProtocol * rgba = dynamic_cast<CCRGBAProtocol *>(*beg);
if (rgba != NULL)
rgba->setOpacity(opacity);
}
}
示例11: setTreeOpacity
void CCUtils::setTreeOpacity(CCNode* n, int o) {
// self
CCRGBAProtocol* p = dynamic_cast<CCRGBAProtocol*>(n);
if(p) {
p->setOpacity((GLubyte)o);
}
// children
CCArray* children = n->getChildren();
CCObject* pObj = NULL;
CCARRAY_FOREACH(children, pObj) {
setTreeOpacity((CCNode*)pObj, o);
}
示例12: addChild
void CCSpecialSprite::addChild(CCNode *pChild, int zOrder, int tag)
{
CCSprite::addChild(pChild, zOrder, tag);
setTexture(((CCSprite*)pChild)->getTexture());
CCRGBAProtocol * rgba = dynamic_cast<CCRGBAProtocol *>(pChild);
if (rgba != NULL)
{
rgba->setColor(this->getColor());
rgba->setOpacity(this->getOpacity());
}
}
示例13: setOpacity
void CCControlButton::setOpacity(GLubyte opacity)
{
m_cOpacity = opacity;
CCObject* child;
CCArray* children=getChildren();
CCARRAY_FOREACH(children, child)
{
CCRGBAProtocol* pNode = dynamic_cast<CCRGBAProtocol*>(child);
if (pNode)
{
pNode->setOpacity(opacity);
}
}
示例14: fadeInRecursively
void CCTreeFadeIn::fadeInRecursively(CCNode* n, float time) {
CCArray* children = n->getChildren();
int cc = n->getChildrenCount();
for(int i = 0; i < cc; i++) {
CCNode* child = (CCNode*)children->objectAtIndex(i);
if(!m_excludeList.containsObject(child)) {
CCRGBAProtocol* p = dynamic_cast<CCRGBAProtocol*>(child);
if(p) {
p->setOpacity((GLubyte)(255 * time));
}
}
fadeInRecursively(child, time);
}
}
示例15:
void Crystal820Layer::updateColor(void)
{
CCLayerColor::updateColor();
if(m_pChildren && m_pChildren->count() > 0)
{
CCObject* child;
CCARRAY_FOREACH(m_pChildren, child)
{
CCNode* pNode = (CCNode*) child;
CCRGBAProtocol *pRGBAProtocol = dynamic_cast<CCRGBAProtocol*>(pNode);
if (pRGBAProtocol)
{
pRGBAProtocol->setOpacity(m_cOpacity);
}
}