Cocos2d, right? It would be good if you could preface your topics with a mention of what OS/SDK etc you are using, or even tag the thread title with it to make it easier for people to figure out what is going on.
Scaling of bodies is really scaling of fixtures, since bodies have no real size. And scaling of fixtures really just amounts to moving the vertices. You can use the S key to scale things the same as for images.
oh... you're talking about in the loader, right. Well, you would have to iterate over all the bodies to be scaled, and iterate over all their fixtures and all the vertices of those fixtures, and transform them by some matrix. So I guess technically that's a 'yes', but a 'no' if you're looking for an easy way :p
iirc since the flip attribute does not change after loading like some other attributes of a sprite do (position, angle etc), the sample loader is only making use of the flip once, at the time of loading. The sprite color and scale are treated the same too.
I have a vague memory of leaving out the flip attribute from the very first cocos2d sample I uploaded, then I realized and amended it. If you got the source code during that time, you might have a version that ignores the flip setting. The relevant code is in the afterLoadProcessing method of RUBELayer.mm, you should have this section in there:
Code: Select all
// these will not change during simulation so we can set them now
[sprite setScale:img->scale / [sprite contentSizeInPixels].height * contentScaleFactor];
[sprite setScaleX:[sprite scale] * img->aspectScale];
[sprite setFlipX:img->flip];
[sprite setColor:ccc3(img->colorTint[0], img->colorTint[1], img->colorTint[2])];
[sprite setOpacity:img->colorTint[3]];