Skip to content

Instantly share code, notes, and snippets.

@Volune
Created August 26, 2014 01:05
Show Gist options
  • Save Volune/b843f6966a5ba224ed74 to your computer and use it in GitHub Desktop.
Save Volune/b843f6966a5ba224ed74 to your computer and use it in GitHub Desktop.
function createBackground() {
}
var StartScreenLayer = cc.Layer.extend({
ctor: function () {
this._super();
// this function can call createBackground!
createBackground.call(this);
},
callCreateBackgroundToo: function () {
// I can call createBackground too!
createBackground.call(this);
}
});
var StartScreenLayer = cc.Layer.extend((function(){
function createBackground() {
}
return {
ctor: function () {
this._super();
// this function can call createBackground!
createBackground.call(this);
},
callCreateBackgroundToo: function () {
// I can call createBackground too!
createBackground.call(this);
}
};
})());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment