for some reason cocos studio ui editor created buttons are not working for me.
here is what i did,
#1, create a test ui page with only one button use cocos studio ui editor, (i had “Touchable” selected)
#2, load json from my scene
this.*uiLayer = ccs.UILayer.create;
this.*uiLayer.scheduleUpdate();
this.addChild(this.*uiLayer, 100);
this.*widget = ccs.GUIReader.getInstance().widgetFromJsonFile(“xxx.json”);
this.*uiLayer.addWidget;
this.*uiLayer.getWidgetByName(“mybtn”).addTouchEventListener(this.testCallback,this);
testCallback:function(sender, type) {
cc.log(“button clicked”);
}
for some reason, testCallback function almost never get triggered (I had it happened twice after millions of tries)