一些代码;
Pipe *pipe = [[Pipe alloc] initWithImagenamed:pipeImagename]; [pipe setCenterRect:CGRectMake(26.0/kPipeWIDth,26.0/kPipeWIDth,4.0/kPipeWIDth,4.0/kPipeWIDth)]; [pipe setYScale:height/pipe.size.height]; [pipe setposition:CGPointMake(320+(pipe.size.wIDth/2),abs(pipeYOffset + (pipe.size.height/2)))]; pipe.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:pipe.size]; [pipe.physicsBody setAffectedByGravity:NO]; [pipe.physicsBody setDynamic:NO];
任何帮助将不胜感激.谢谢!
解决方法Pipe *pipe = [[Pipe alloc] initWithImagenamed:pipeImagename]; [pipe setCenterRect:CGRectMake(26.0/kPipeWIDth,4.0/kPipeWIDth)];//set the physicsBody before X/Yscale pipe.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:pipe.size]; [pipe setYScale:height/pipe.size.height]; [pipe setposition:CGPointMake(320+(pipe.size.wIDth/2),abs(pipeYOffset + (pipe.size.height/2)))]; [pipe.physicsBody setAffectedByGravity:NO]; [pipe.physicsBody setDynamic:NO];
这可能对你有所帮助.我认为这是ios7.1中的一个错误.
总结以上是内存溢出为你收集整理的objective-c – Sprite Kit – iOS 7.1更新后由于比例而导致的对象冲突全部内容,希望文章能够帮你解决objective-c – Sprite Kit – iOS 7.1更新后由于比例而导致的对象冲突所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)