1
\$\begingroup\$

I'm making a game for iPhone and iPad w/ Cocos2D and Box2D. I scale the size of square objects ("blocks") using a pixel-to-meters ratio depending on the particular device. Can I stretch or shrink the textures and CCSprites as well? I was considering having just one "blockImage.png" file and scaling it up/down depending on the device.

The alternative is having 2-3 sets of images for iPhone, iPhone 4, iPad etc.

Cheers!

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I'd recommend offline creating your assets at the highest resolution possible, then for your purposes create a PNG for each target platform requirements separately. It'll be more efficient on memory and it'll also be faster for the graphics hardware not having to scale things down (and process unnecessary texels). It seems a relatively trivial amount of work to create a couple of different sized versions and having the loading code look for and load a version that matches the platform your running on.

You can more than likely just get away with just scaling down however (scaling up would just look blocky), I don't think if you're just doing 2D you'd probably see any artefacts that 3D would suffer with when using a large texture for a small area of the screen (the way the hardware samples from the texture isn't consistent as a polygon moves and you can see weird sampling issues - problems improved by more complex filtering algorithms and mipmaps).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .