IOS调整大小CCSprite无法正常工作
问题描述:
我知道这是一个非常愚蠢的问题,但我试图调整大小,而不是反感。IOS调整大小CCSprite无法正常工作
CCSprite * title;
title = [CCSprite spriteWithFile:@"flow.png"];
[title setScaleX:0.55f];
[title setScaleY:0.55f];
答
调整大小雪碧flollowing代码
-(void)Spriteresize:(CCSprite*)sprite toWidth:(float)width toHeight:(float)height
{
sprite.scaleX = width/sprite.contentSize.width;
sprite.scaleY = height/sprite.contentSize.height;
}
使用此方法如下
[self Spriteresize:title toWidth:300 toHeight:200];
你的意思是你看到的完全一样,如果你不设置同样的事情缩放到(0.55,0.55)?如果是这样,它必须在别的地方改变。 –