Skip to content

Instantly share code, notes, and snippets.

@nise-nabe
Created April 12, 2015 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nise-nabe/eef2f295d068ad558c65 to your computer and use it in GitHub Desktop.
Save nise-nabe/eef2f295d068ad558c65 to your computer and use it in GitHub Desktop.
var ColorScene = cc.Scene.extend({
ctor: function(color) {
cc.Scene.prototype.ctor.call(this);
this.layerColor = color;
},
onEnter:function () {
var color = this.layerColor;
var ColorLayer = cc.Layer.extend({
init:function () {
this._super();
var colorLayer = new cc.LayerColor(color);
this.addChild(colorLayer);
}
});
this._super();
var layer = new ColorLayer();
this.addChild(layer);
layer.init();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment