当前位置: 首页>>代码示例>>C++>>正文


C++ CCRGBAProtocol::setOpacity方法代码示例

本文整理汇总了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);
    }
}
开发者ID:chenxu111,项目名称:Cocos2d-x-For-CocoStudio,代码行数:8,代码来源:UIWidget.cpp

示例2: updateBackGroundImageOpacity

void Layout::updateBackGroundImageOpacity()
{
    CCRGBAProtocol* rgba = dynamic_cast<CCRGBAProtocol*>(_backGroundImage);
    if (rgba)
    {
        rgba->setOpacity(_backGroundImageOpacity);
    }
}
开发者ID:boruis,项目名称:cocos2dx-classical,代码行数:8,代码来源:Layout.cpp

示例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);
		}
	}
}
开发者ID:duzhi5368,项目名称:FKCocos2dxWrapper_2.x,代码行数:47,代码来源:FKCW_Action_TreeFadeOut.cpp

示例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));*/
}
开发者ID:noriter,项目名称:nit,代码行数:9,代码来源:CCActionInterval.cpp

示例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)));*/	
}
开发者ID:Openxlive,项目名称:cocos2d-x-win8-tests-metro-style,代码行数:9,代码来源:CCActionInterval.cpp

示例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));*/
}
开发者ID:valentinvit,项目名称:cocos2d-x,代码行数:9,代码来源:CCActionInterval.cpp

示例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));*/
}
开发者ID:Bahamut,项目名称:cocos2d-x,代码行数:9,代码来源:CCActionInterval.cpp

示例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());
    }
}
开发者ID:Michael-Z,项目名称:SouShen,代码行数:10,代码来源:GUINodeRGBA.cpp

示例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);
        }
    }
}
开发者ID:ShortTailLab,项目名称:cocos2d-x,代码行数:12,代码来源:UILayout.cpp

示例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);
    }
}
开发者ID:KAndQ,项目名称:cocos2dx-utils,代码行数:13,代码来源:CCSpecialSprite.cpp

示例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);
	}
开发者ID:live17909,项目名称:cocos2dx-better,代码行数:13,代码来源:CCUtils.cpp

示例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());
	}
}
开发者ID:bontey,项目名称:cocos2d-x-tools,代码行数:13,代码来源:CCSpecialSprite.cpp

示例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);
        }
    }
开发者ID:tungt84,项目名称:cocos2d-blackberry,代码行数:14,代码来源:CCControlButton.cpp

示例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);
    }
}
开发者ID:WilliamRen,项目名称:cocos2dx-better,代码行数:15,代码来源:CCTreeFadeIn.cpp

示例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);
			}
		}
开发者ID:chenyufeng,项目名称:QATDemo-chinese,代码行数:15,代码来源:Crystal820Layer.cpp


注:本文中的CCRGBAProtocol::setOpacity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。