0
votes

I am trying to scale down a high resolution CCSprite in Cocos2D by setting the scale of the sprite as such:

mySprite.scale = 0.5f;

The problem is that the scaled-down image is not resampled, and appears pixelated. Is there a way to get a resampled version of the sprite in Cocos2D, or enable resampling at some level in the Cocos2D hierarchy (CCLayer, CCScene, CCDirector, etc.)?

1
this won't give good quality or good performance. Are you trying to avoid including SD images? - LearnCocos2D
No, I just want to implement zoom-in/zoom-out for a large map. Performance is not an issue, since not much is going on anyway other than viewing the map, and there will be a discrete number of zoom levels instead of being continuous. - owobeid

1 Answers

0
votes

You could try setting:

[texture setAliasTexParameters];

on the sprite texture and see if that improve things.

Otherwise, the only approach that I see is resampling the image at the OpenGl level. This would involve using gluScaleImage on your texture and would be slightly more complex to attain.