getContentSize() bug #1237
-
Hi, auto test = ax::Sprite::create("redRect.png"); And the results are 62.5 width and 62.5 height. I can't figure out why is that. Is it a but or am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The contentSize of sprite affected by contentScaleFacotor, not the image pixel wide, if you want get the image pixel wide and height, use follow code: auto test = ax::Sprite::create("redRect.png");
auto texture = test->getTexture();
int imageWidth = texture->getPixelsWide();
int imageHeight = texture->getPixelsHigh(); |
Beta Was this translation helpful? Give feedback.
The contentSize of sprite affected by contentScaleFacotor, not the image pixel wide, if you want get the image pixel wide and height, use follow code: