Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17124

Not able to get the correct size of node created by spine2d

$
0
0

@satyaKT wrote:

Hello there,
I am trying to get the size of node which is created from spine,but i am getting my width and height as 0.
Here is my code

Size s = Director::getInstance()->getVisibleSize();
auto SpineNode1 = SkeletonAnimation::createWithFile("skeleton.json", "skeleton.atlas", 0.5f);
SpineNode1->setPosition(Vec2(s.width/2,s.height/2));
auto rect1 = SpineNode1->SkeletonRenderer::getBoundingBox();
auto s1 =rect1.size;
CCLog("width =%f,height = %f",s1.widht,s1.height);
CCLog("minX = %f,maxX = %f",rect1.getMinX(),rect1.getMaxX());

every time in the log i am getting log as width=0.000000,height=0.000000
minX = 360.000000,maxX = 360.000000
am i doing any thing wrong or is there any other way to get the size of node created from spine?

Thanks!

@zhangxm @slackmoehrle

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17124

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>