IOS Resize CCSprite不工作
我知道这是一个非常愚蠢的问题,但我正在尝试调整大小,而不是反思IOS Resize CCSprite不工作,ios,objective-c,cocos2d-iphone,Ios,Objective C,Cocos2d Iphone,我知道这是一个非常愚蠢的问题,但我正在尝试调整大小,而不是反思 CCSprite * title; title = [CCSprite spriteWithFile:@"flow.png"]; [title setScaleX:0.55f]; [title setScaleY:0.55f]; 调整精灵浮动代码的大小 -(void)Spriteresize:(CCSprite*)sprite toWidth:(float)width toHeight:(float)height {
CCSprite * title;
title = [CCSprite spriteWithFile:@"flow.png"];
[title setScaleX:0.55f];
[title setScaleY:0.55f];
调整精灵浮动代码的大小
-(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)?如果是这样,它也必须在其他地方改变。