bool UIWidget::isCascadeOpacityEnabled() { CCRGBAProtocol* rgbap = DYNAMIC_CAST_CCRGBAPROTOCOL; if (rgbap) { return rgbap->isCascadeOpacityEnabled(); } return false; }
/** Override synthesized setOpacity to recurse items */ void CCLayerRGBA::setOpacity(GLubyte opacity) { _displayedOpacity = _realOpacity = opacity; if( _cascadeOpacityEnabled ) { GLubyte parentOpacity = 255; CCRGBAProtocol *parent = dynamic_cast<CCRGBAProtocol*>(m_pParent); if (parent && parent->isCascadeOpacityEnabled()) { parentOpacity = parent->getDisplayedOpacity(); } updateDisplayedOpacity(parentOpacity); } }