请问怎样才能准确获取Label的实际渲染宽高?

当前代码:


        var NewText1 = new cc.Node( 'NewText1' );

        var NewText1Layout = NewText1.addComponent( cc.Layout );
        NewText1Layout.Type = 'HORIZONTAL';
        NewText1Layout.ResizeMode = 'CHILDREN';

        var NewText1Label = NewText1.addComponent( cc.Label );
        NewText1Label.string = "这是一段新的测试文字可敬可嘉";
        NewText1Label.horizontalAlign = 'CENTER';
        NewText1Label.verticalAlign = 'CENTER';
        NewText1Label.fontSize = 80;
        NewText1Label.lineHeight = 80;
        NewText1Label.overflow = 'RESIZE_HEIGHT';
        NewText1Label.useSystemFont = true;
        NewText1Label.enableWrapText = true;
        NewText1Label.fontFamily = 'Aria';

        that.card.addChild(NewText1);

期望效果是能以 Label 的实际渲染宽高来初始化 NewText1 的宽高。目前的显示效果是这样

NewText1 的宽高始终是 300*200, 无论我的 Label 字号设置为多少。

如果不能根据 Label 来自动设置节点宽高的话,手动根据 Label 宽高来自行设置,要怎样取得 Label 的宽高值?

我试了几种方式好像都没有获取到

有一些组件设置了自适应后,要到下一帧节点上的数据才会变成实际的大小
可以通过监听节点大小变化的事件来获取节点实际大小信息
大概是这个样子,不知道有没有对,细节记不太清了。

this.textLabel = NewText1;
this.textLabel.on("size-changed", this.onLabelSizeChanged, this);

// ...

onLabelSizeChanged(){
    cc.log(this.textLabel.width);
    cc.log(this.textLabel.height);
}

感谢回复。

NewText1Layout.updateLayout();

手动刷新没有效果。

NewText1.on("size-changed", function(){
    console.log(NewText1.width);
    console.log(NewText1.height);
}, that);

这个回调也是只被调用了一次,也是显示 300*200

仔细看了下图,貌似不是我说的这个问题。。
Label的属性检查器里面有一个Overflow的值设置成RESIZE_HEIGHT应该就可以了

你看我上面的代码,NewText1Label 的 overflow 已经设置了