opertorPath1 = resources\engine\cocos2d\core\components; //操作路径1
opertorPath2 = resources\engine\jsb; //操作路径2
opertorPath3 = resources\engine\cocos2d\core\label; //操作路径3
1. 拷贝 [CCLabelShadow.js] 到 @opertorPath1;
2. 在 @opertorPath2 路径中下的jsb-label.js 文件中添加
//阴影
jsbLabel.prototype.setEnableShadow = function(color, offset) {
this._shadowColor = color;
var shadowOffset = cc.size(0, 0);
shadowOffset.width = offset.x;
shadowOffset.height = offset.y;
this.enableShadow(color, shadowOffset);
}
3. 在 @opertorPath1 路径下的 index.js 文件中添加
require('./CCLabelShadow'),
4. 在 @opertorPath3 路径下的 line:425 添加一下代码
if(this._node.getShadowEnabled()) {
var shadowColor = this._node.getShadowColor() || cc.color(255, 255, 255, 255);
var shadowBlur = this._node.getShadowBlur() || 10;
var shadowOffset = this._node.getShadowOffset() || {x: 0, y: 0};
this._labelContext.shadowBlur = shadowBlur;
this._labelContext.shadowColor = shadowColor;
this._labelContext.shadowOffsetX = shadowOffset.x;
this._labelContext.shadowOffsetY = shadowOffset.y;
}
5. engine目录下执行 gulp build指令;重启编辑器。