Skip to content

getContentSize() bug #1237

Closed Answered by halx99
rudiHammad asked this question in Q&A
Jun 19, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

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();

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@rudiHammad
Comment options

@rh101
Comment options

rh101 Jun 19, 2023
Collaborator

@rudiHammad
Comment options

Answer selected by halx99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants