Merge pull request #2161 from 2youyou2/next

support tiled&filled sprite mode
This commit is contained in:
pandamicro
2017-12-07 09:52:30 +08:00
committed by GitHub
2 changed files with 825 additions and 121 deletions
+12 -9
View File
@@ -265,9 +265,16 @@ var Sprite = cc.Class({
return this._fillType;
},
set: function(value) {
this._fillType = value;
if (this._type === SpriteType.FILLED && this._renderData) {
this._renderData.vertDirty = true;
if (value !== this._fillType) {
if (value === FillType.RADIAL || this._fillType === FillType.RADIAL) {
RenderData.free(this._renderData);
this._renderData = null;
}
else if (this._renderData) {
this._renderData.uvDirty = true;
this._renderData.vertDirty = true;
}
this._fillType = value;
}
},
type: FillType,
@@ -315,6 +322,7 @@ var Sprite = cc.Class({
set: function(value) {
this._fillStart = cc.clampf(value, -1, 1);
if (this._type === SpriteType.FILLED && this._renderData) {
this._renderData.uvDirty = true;
this._renderData.vertDirty = true;
}
},
@@ -339,6 +347,7 @@ var Sprite = cc.Class({
set: function(value) {
this._fillRange = cc.clampf(value, -1, 1);
if (this._type === SpriteType.FILLED && this._renderData) {
this._renderData.uvDirty = true;
this._renderData.vertDirty = true;
}
},
@@ -473,12 +482,6 @@ var Sprite = cc.Class({
this._renderData = null;
},
_sizeChanged: function () {
if (this._renderData) {
this._renderData.vertDirty = true;
}
},
_activateMaterial: function () {
// cannot be activated if texture not loaded yet
if (!this._spriteFrame.textureLoaded) {
File diff suppressed because it is too large Load Diff