public CCLayerRGBA()
        {
            _displayedOpacity = _realOpacity = OpacityTransform.Default;
            _displayedColor   = _realColor = ColorTransform.Default;

            this.cascadeOpacityEnabled = false;
            this.cascadeColorEnabled   = false;
        }
        public virtual void updateDisplayedOpacity(OpacityTransform parentOpacity)
        {
            _displayedOpacity.tint = (byte)(_realOpacity.tint * parentOpacity.tint / 255.0f);
            _displayedOpacity.add  = (byte)(_realOpacity.add * parentOpacity.tint + parentOpacity.add);

            if (_cascadeOpacityEnabled && _children != null)
            {
                var enumerator = _children.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    CCNode item = enumerator.Current;
                    if (item is CCRGBAProtocol)
                    {
                        ((CCRGBAProtocol)item).updateDisplayedOpacity(_displayedOpacity);
                    }
                }
            }
        }
Esempio n. 3
0
 public override void updateDisplayedOpacity(OpacityTransform parentOpacity)
 {
     base.updateDisplayedOpacity(parentOpacity);
     updateColor();
 }