Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.