예제 #1
0
        public CCLayerRGBA()
        {
            _displayedOpacity = _realOpacity = OpacityTransform.Default;
            _displayedColor   = _realColor = ColorTransform.Default;

            this.cascadeOpacityEnabled = false;
            this.cascadeColorEnabled   = false;
        }
예제 #2
0
        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);
                    }
                }
            }
        }
예제 #3
0
 public override void updateDisplayedOpacity(OpacityTransform parentOpacity)
 {
     base.updateDisplayedOpacity(parentOpacity);
     updateColor();
 }