That\'s the question xD
Given an instance of a CCSprite in cocos2d in iphone, what method can I use to obtain the image width and height?
In cocos2d-x v3.x, boundingBox
is deprecated in the Node class (i.e. the super class of Sprite). Use the following code instead:
auto spriteWidth = sprite->getTextureRect().size.width;
auto spriteHeight = sprite->getTextureRect().size.height;
or
auto spriteWidth = sprite->getContentSize().width;
auto spriteHeight = sprite->getContentSize().height;