Skip to content

Commit

Permalink
add enchant.Scene#remove (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtsan committed Sep 11, 2014
1 parent a79e5ac commit 6aded77
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dev/src/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ enchant.Scene = enchant.Class.create(enchant.Group, {
this._backgroundColor = this._element.style.backgroundColor = color;
}
},
remove: function() {
this.clearEventListener();

while (this.childNodes.length > 0) {
this.childNodes[0].remove();
}

return enchant.Core.instance.removeScene(this);
},
/**#nocode-*/
_oncoreresize: function(e) {
this._element.style.width = e.width + 'px';
Expand Down

0 comments on commit 6aded77

Please sign in to comment.