IOS SpriteKit带有TexturePacker的模糊雪碧。

问题描述 投票:0回答:1

我正在用IOS Sprite kit (Objective-C)做一个项目,我使用TexturePacker来制作SheetAtlas,在我的场景视图中,我只显示一个角色动画,没有别的,但我有一个问题,当我显示我的Sprite时,它是模糊的。

图像精灵的分辨率是512*512(我认为这很好),Sheet的大小是2048*2048。

我在TexturePacker上试了很多方法来提高质量,但都没有效果,当我直接在TexturePacker上显示我的动画时,质量很好,但当我在XCode上试的时候,结果都是模糊的,我试过用数组动画播放我的角色动画,结果也不模糊(但这个技术用了很多内存),所以我认为问题出在TexturePacker上。

有谁有同样的问题是会有一个解决方案?

这是我的代码。

[self.scene setBackgroundColor:[UIColor clearColor]];
self.view.allowsTransparency = YES;

// load the atlas explicitly, to avoid frame rate drop when starting a new animation
self.atlas = [SKTextureAtlas atlasNamed:CHARACTER_ATLAS_NAME];

SKAction *walk = [SKAction animateWithTextures:CHARACTER_ANIM_IDLE timePerFrame:0.033];

self.sequence = [SKAction repeatActionForever:walk];

SKSpriteNode *sprite = [SKSpriteNode spriteNodeWithTexture:CHARACTER_TEX_HELLO_0]; 

sprite.size = CGSizeMake(self.view.frame.size.width, self.view.frame.size.height);

sprite.position = CGPointMake(sprite.size.width/2, sprite.size.height/2);


[sprite runAction:sequence];
[self addChild:sprite];

这里是一个比较上的精灵,当我使用的图像阵列和下面的SpriteKit和Texturepacker(你可以看到的差异,特别是在眼睛的水平

enter image description here

谢谢你的帮助

ios objective-c sprite-kit sprite texturepacker
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.