When launching the TestColors function, the colors of the LabelBMFont are lost (it becames black) if compiling the code in a single js file (with closure compiler, both simple and advanced mode).
Works perfectly when not compiled.
Here is the code
In resources.js i added
var s_HelloWorld = "res/HelloWorld.png";
var s_CloseNormal = "res/CloseNormal.png";
var s_CloseSelected = "res/CloseSelected.png";
var f_F32 = "res/konqa32.fnt",t_F32 = "res/konqa32.png";
var g_resources = [
//image
{src:s_HelloWorld},
{src:s_CloseNormal},
{src:s_CloseSelected},
//fnt
{src:f_F32},{src:t_F32}
];
In MyApp.js, init()
...
this.sprite.runAction(cc.Sequence.create(rotateToA, scaleToA));
this.helloLabel.runAction(cc.Spawn.create(cc.MoveBy.create(2.5, cc.p(0, size.height - 40)),cc.TintTo.create(2.5,255,125,0)));
//START ADDED CODE
this.lTest = cc.LabelBMFont.create("TEST COLORS",f_F32);
this.lTest.setColor(cc.ORANGE);
var milTest = cc.MenuItemLabel.create(this.lTest,this.TestColors,this);
milTest.setPosition(cc.p(400,350));
var _Menu = cc.Menu.create(milTest);
_Menu.setPosition(cc.p(0,0));
this.addChild(_Menu);
//END ADDED CODE
this.setTouchEnabled(true);
return true;
},
//ADDED FUNCTION
TestColors:function (sender) {
this.lTest.setColor(cc.GREEN);
this.helloLabel.setColor(cc.GREEN);
},//END ADDED FUNCTION
// a selector callback
menuCloseCallback:function (sender) {
cc.Director.getInstance().end();
},
...
Happens using 2.2.1, 2.2 and 2.1.5.
Any ideas? Is it a bug?