I am creating a planet with the following code
CCSprite *planet = [CCSprite spriteWithFile:@"planet.png" rect:CGRectMake(0, 0, width, width)];
The planet itself is far larger than 48x48 so currently the image just clips. I would like the image to auto size into the container. How do I do this?
assuming the container's width is 'width', a number greater than 0:
CCSprite *planet = [CCSprite spriteWithFile:@"planet.png"];
planet.scale=width/MAX(planet.contentSize.width,planet.contentSize.height);
Although if you are trying to get an icon sized planet (48 points) i suggest you create a texture for that rather than scaling down a very large image ... your mileage may vary on rendering quality when scaling down or up too much.