sktextureatlas

Does Sprite Kit load a texture atlas multiple times if I use SKTextureAtlas later?

眉间皱痕 提交于 2019-11-30 19:11:38
问题 This is making me think. Game starts and I create sprites with -spriteNodeWithImageNamed: method. Later for animation, I create a SKTextureAtlas object. Some people say it is faster because -spriteNodeWithImageNamed: will first look in your app bundle for a png and after this it will look into the atlas. But what is unclear to me: If I create a SKTextureAtlas later will this know about the already loaded atlas image or will it be dumb and just load the image again? And if I create

How does SKTexture caching and reuse work in SpriteKit?

心不动则不痛 提交于 2019-11-28 20:53:21
It is often mentioned on StackOverflow that SpriteKit does its own internal caching and reuse. Does Sprite Kit load a texture atlas multiple times if I use SKTextureAtlas later? should I cache textures in properties in sprite kit? SpriteKit memory management preload cached and fps issue If I don't make any effort to reuse textures or atlases, what caching and reuse behavior can I expect from SpriteKit? Karl Voskuil Texture Caching in SpriteKit “Long story short: rely on Sprite Kit to do the right thing for you.” -@LearnCocos2D Here’s the long story, as of iOS 9. The texture’s bulky image data

Render nodes in single drawing pass with spritekit?

青春壹個敷衍的年華 提交于 2019-11-28 07:48:34
As I was looking around for information about spritekit textures, and I stumbled upon this quote: If all of the children of a node use the same blend mode and texture atlas, then Sprite Kit can usually draw these sprites in a single drawing pass. On the other hand, if the children are organized so that the drawing mode changes for each new sprite, then Sprite Kit might perform as one drawing pass per sprite, which is quite inefficient. But check this out: Tiles with same texture (I assure you it's a texture, not just a color) Tiles with their own texture The draw count has a difference of 40,

Spritekit - not loading @3x images from SKTextureAtlas

做~自己de王妃 提交于 2019-11-27 04:33:00
Since my sample project was deleted (I thought this would be much easier to test), I will post some code and images to illustrate my point. Here are sample images My atlas setup: My launch image setup: The code where I add these sprites to my scene override func didMoveToView(view: SKView) { let texture = SKTextureAtlas(named: "scenery") let test = SKSpriteNode(texture: texture.textureNamed("test")) test.position = CGPoint(x: self.size.width/2, y: self.size.height/2) self.addChild(test) } These are my results: iPhone 5 simulator: iPhone 6 plus simulator: I've tried changing the launch image to

Render nodes in single drawing pass with spritekit?

ぐ巨炮叔叔 提交于 2019-11-27 01:59:46
问题 As I was looking around for information about spritekit textures, and I stumbled upon this quote: If all of the children of a node use the same blend mode and texture atlas, then Sprite Kit can usually draw these sprites in a single drawing pass. On the other hand, if the children are organized so that the drawing mode changes for each new sprite, then Sprite Kit might perform as one drawing pass per sprite, which is quite inefficient. But check this out: Tiles with same texture (I assure you