标签:style blog color io os ar for div sp
Flash在滤镜方面做得比较成熟,starling也有很多现成的办法。
this.color = cc.color(150,150,150); this.setColor(cc.color(150,150,150)) var action = cc.tintTo(1, 150,150,150); this.runAction(action);
setColor: function (color) { var locDisplayedColor = this._displayedColor, locRealColor = this._realColor; locDisplayedColor.r = locRealColor.r = color.r; locDisplayedColor.g = locRealColor.g = color.g; locDisplayedColor.b = locRealColor.b = color.b; var parentColor, locParent = this._parent; if (locParent && locParent.cascadeColor) parentColor = locParent.getDisplayedColor(); else parentColor = cc.color.WHITE; this.updateDisplayedColor(parentColor); /*if (color.a !== undefined && !color.a_undefined) { //setColor doesn‘t support changing opacity, please use setOpacity this.setOpacity(color.a); }*/ }, /** * Update the displayed color of Node * @function * @param {cc.Color} parentColor */ updateDisplayedColor: function (parentColor) { var locDispColor = this._displayedColor, locRealColor = this._realColor; locDispColor.r = 0 | (locRealColor.r * parentColor.r / 255.0); locDispColor.g = 0 | (locRealColor.g * parentColor.g / 255.0); locDispColor.b = 0 | (locRealColor.b * parentColor.b / 255.0); if (this._cascadeColorEnabled) { var selChildren = this._children; for (var i = 0; i < selChildren.length; i++) { var item = selChildren[i]; if (item) item.updateDisplayedColor(locDispColor); } } },
标签:style blog color io os ar for div sp
原文地址:http://www.cnblogs.com/kenkofox/p/3988857.html