@marcinwal wrote:
I have the following code which works fine in the browser but I cannot get contentSize while running it on android device.
var elementNameLevel = new cc.LabelTTF("", "Helvetica",this.winSize.height / 15); elementNameLevel.setColor(cc.color(255,102,0)); elementNameLevel.setString(this.elementName); elementNameLevel.setPosition(cc.p(this.winSize.width / 2 , startY)); elementNameLevel.enableStroke(cc.color(0,0,0),2,true); this.congsLayer.addChild(elementNameLevel,3); var widthLetter = elementNameLevel.getContentSize().width;
widthLetter returns 0 most likely due to delayed callback results if I am correct. How should I read that value?
Posts: 1
Participants: 1