How to get ContentSize of Nodes and Skeletons from Cocos Studio?

I’ve tried using node->getContentSize().width and node->getContentSize().height after creating the node from .csb files from cocos studio, but those values always end up being zero.

Is there a way to get the content sizes of the nodes and skeletons that we create from .csb files with Cocos Studio?

Any solutions?

I am not sure about skeletons, but pure Nodes from Cocos Studio will always give a content size of zero. This is because it is not possible to set the content size for pure nodes in studio. If you need to set custom size in studio, you will need to use layer instead.

So would it work if I were to create a layer as a container and then place the node within the layer? Is it possible to resize the layer to be the exact size of the node?

Is the node created in Cocos Studio? If it is, it has zero content size. So, you will have to place the node as a child to a layer, with the layer’s size being the node size which you want.

The next best thing is whatever you are doing with the node, just do it on a layer. They are the same.