如题,下面的代码,就创建两个精灵而已,直接运行是不错的,但是cocos code ide里面浏览器运行是不行的,放在apache下面也不行。黑屏,这是为什么?
放在webstorm下面,有时报这个错,蛋疼啊,求解。
Cocos2d-JS v3.0 Final
Uncaught TypeError: Cannot read property ‘_name’ of undefined
this.sprite = new cc.Sprite(res.HelloWorld_png);
this.sprite.attr({
x: size.width / 2,
y: size.height / 2,
scale: 0.5,
rotation: 180
});
this.addChild(this.sprite, 0);
var s2 = cc.Sprite("res/HelloWorld.png");
s2.attr({
x: size.width / 2,
y: size.height / 2 - 200,
scale: 0.3
});
this.addChild(s2,3);




