mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 19:42:39 +08:00
Merge pull request #2161 from 2youyou2/next
support tiled&filled sprite mode
This commit is contained in:
@@ -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
Reference in New Issue
Block a user