Created
April 12, 2015 03:20
-
-
Save nise-nabe/eef2f295d068ad558c65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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