mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Merge pull request #257 from jareguo/v0.7
sprite should not display if disabled in scene
This commit is contained in:
@@ -372,6 +372,10 @@ var Sprite = cc.Class({
|
||||
_createSgNode: function () {
|
||||
var sgNode = new cc.Scale9Sprite();
|
||||
|
||||
if ( !this.enabledInHierarchy ) {
|
||||
sgNode.setVisible(false);
|
||||
}
|
||||
|
||||
this._applySpriteFrame(sgNode, null);
|
||||
|
||||
// should keep the size of the sg node the same as entity,
|
||||
|
||||
Reference in New Issue
Block a user