public virtual void updateDisplayedColor(ColorTransform parentColor) { Color displayedTint = _displayedColor.tint; Color displayedAdd = _displayedColor.add; displayedTint.r = (byte)(_realColor.tint.r * parentColor.tint.r / 255.0f); displayedTint.g = (byte)(_realColor.tint.g * parentColor.tint.g / 255.0f); displayedTint.b = (byte)(_realColor.tint.b * parentColor.tint.b / 255.0f); displayedAdd.r = (byte)(_realColor.add.r * parentColor.tint.r + parentColor.add.r); displayedAdd.g = (byte)(_realColor.add.g * parentColor.tint.g + parentColor.add.g); displayedAdd.b = (byte)(_realColor.add.b * parentColor.tint.b + parentColor.add.b); _displayedColor.tint = displayedTint; _displayedColor.add = displayedAdd; if (_cascadeColorEnabled && _children != null) { var enumerator = _children.GetEnumerator(); while (enumerator.MoveNext()) { CCNode item = enumerator.Current; if (item is CCRGBAProtocol) { ((CCRGBAProtocol)item).updateDisplayedColor(_displayedColor); } } } }
public CCLayerRGBA() { _displayedOpacity = _realOpacity = OpacityTransform.Default; _displayedColor = _realColor = ColorTransform.Default; this.cascadeOpacityEnabled = false; this.cascadeColorEnabled = false; }
public override void updateDisplayedColor(ColorTransform parentColor) { base.updateDisplayedColor(parentColor); updateColor(); }