I searched around a bit, but couldn’t find anything for the sake of solution. How to solve this issue? Or is it a problem that I created?
I am trying to implement the tutorial here: [[http://www.gamefromscratch.com/post/2012/06/17/Cocos2D-HTML-Tutorial-4-It’s-all-about-control.aspx]]
var MyThirdApp = cc.LayerColor.extend(
{ _jetSprite:null,
init:function(){
this._super();
this.initWithColor(new cc.Color4B(0,0,0,255));
var size = cc.Director.getInstance().getWinSize();
.......
Thanks in advance.
Try this.init(color, width, height)
Tried that, but gives “Uncaught RangeError: Maximum call stack size exceeded” error, in CCGeometry.js:1.
Yeah I got this same error.
Wuhao
#5
Hi, the tutorials on gamefromscratch are for cocos2d-html5 2.0
since then, the api has changed a little.
for this sample to work
init:function(){
this._super(new cc.Color4B(0,0,0,255));
//this.initWithColor(new cc.Color4B(0,0,0,255));
@Wuhao wrote:
Hi, the tutorials on gamefromscratch are for cocos2d-html5 2.0
since then, the api has changed a little.
for this sample to work
init:function(){
this._super(new cc.Color4B(0,0,0,255));
//this.initWithColor(new cc.Color4B(0,0,0,255));
You’re fix is not works with Cocos2d-html5 v2.2.2.
How could we solve this?
Hi, @alienwoods
You should use this.init( cc.c4b(0,0,0,255) )
Huabin
@pandamicro
but a new error is
Uncaught RangeError: Maximum call stack size exceeded
firfox crashed during launching.
Ah, that’s because the init function have been override by your own init, so you need to do this:
var MyLayer = cc.LayerColor.extend({
init:function(){
this._super();
cc.LayerColor.prototype.init.call( this, new cc.c4b(0,0,0,255) );
// ...
}
});