CCNode getContentSize

Hello there.

I have found a litle bug or not ,i don’t know :).

When i scale my CCSprite or other CCNode object i use in my code getContentSize() but it returns me not scaled content size is this behavior correct? I think not :slight_smile:

Example

//initialize sprite

LOGN (“Content size:”,m_pSprite->getContentSize().width);
m_pSprite->setScale(GameScene::scale);
LOGN (“Content size:”,m_pSprite->getContentSize().width);

Output is:

cocos2d-x debug info [Content size: 69.000000]
cocos2d-x debug info [Content size: 69.000000]


And when i write ’’( (quotation marks and ( “( ) here it disappeard so SQLInjection is posible :D?
LOGN (”Content size:",m_pSprite->getContentSize().width); <— see here
LOGN ("").width);

Yes it’s correct.

    /** The untransformed size of the node.
     The contentSize remains the same no matter the node is scaled or rotated.
     All nodes has a size. Layer and Scene has the same size of the screen.
     @since v0.8
     */
    CC_PROPERTY_PASS_BY_REF(CCSize, m_tContentSize, ContentSize)

ok thx but is there any method that i can use and get scaled size?

ok sorry there was topic with solution: http://www.cocos2d-x.org/boards/6/topics/938