Is there a way to determine whether an existing SKTexture uses a @2x or @3x image version?
I could look at the texture's size and compare them but I was wondering if there's a more elegant way to do it, preferably without using a UIImage.
Is there a way to determine whether an existing SKTexture uses a @2x or @3x image version?
I could look at the texture's size and compare them but I was wondering if there's a more elegant way to do it, preferably without using a UIImage.
Here's a solution that should work for iOS 9 and OS X 10.11:
CGImageRef imageRef = texture.CGImage;
CGFloat *scale = CGImageGetWidth(imageRef) / [texture size].width;
CGImageRelease(imageRef); // Not sure if you need this line?