sktextureatlas

UImage loads entire SKTextureAtlas instead of just SKTexture

こ雲淡風輕ζ 提交于 2020-04-18 12:50:08
问题 I need texture with 'trueName' to load into my myImageViewOutlet.image. The result I am getting is the entire atlas rendering into it. My code is as follows let myTextureAtlas = SKTextureAtlas.init(named: "myGameTextures") // let texture = myTextureAtlas.textureNamed(trueName) // will render the entire atlas, instead of just the texture by trueName let texture = myTextureAtlas.textureNamed(trueName+”bad name“) // will produce the placeholder image by sprite kit by itself just fine, but it's

UImage loads entire SKTextureAtlas instead of just SKTexture

丶灬走出姿态 提交于 2020-04-18 12:49:49
问题 I need texture with 'trueName' to load into my myImageViewOutlet.image. The result I am getting is the entire atlas rendering into it. My code is as follows let myTextureAtlas = SKTextureAtlas.init(named: "myGameTextures") // let texture = myTextureAtlas.textureNamed(trueName) // will render the entire atlas, instead of just the texture by trueName let texture = myTextureAtlas.textureNamed(trueName+”bad name“) // will produce the placeholder image by sprite kit by itself just fine, but it's

Swift : How to handle a lot of textures in memory

*爱你&永不变心* 提交于 2020-01-01 16:48:10
问题 I have a lot of characters in my game and because of that I have so many textures. When a texture atlas is loaded (containing about 5 different image textures) it increases the memory use and keeps it there at that amount. So the more textures just keeps driving that number up and up until sometimes the application crashes. I don't need all the characters at once, how can i maybe load some character textures when I need them and deallocate the others when i don't, but ill need to be able to

How to make Sprite Kit display @2x images from atlas at correct size?

自古美人都是妖i 提交于 2019-12-31 20:41:32
问题 When a project only has @2x images because it only targets retina display devices, atlas Sprite Kit atlas gets the scale wrong with the RGBA8888_COMPRESSED setting to use with PVR textures. RGBA8888_PNG (the default) sometimes works ok. Before switching to atlas, I had all @2x images in a group and loaded them with: sprite = [SKSpriteNode spriteNodeWithImageNamed:@"theImage.png"]; No problems. Correct size. Now with atlas and RGBA8888_COMPRESSED, I get the SKTexture and the image is way too

Spritekit - not loading @3x images from SKTextureAtlas

一笑奈何 提交于 2019-12-28 02:06:46
问题 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) }

Spritekit - not loading @3x images from SKTextureAtlas

亡梦爱人 提交于 2019-12-28 02:06:28
问题 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) }

Does a SKTexture from a SKTextureAtlas support the mipmap feature?

不想你离开。 提交于 2019-12-23 21:32:40
问题 From apples documentation: "You can only request mipmaps if both of the texture’s dimensions are a power of two." However, it's unclear whether the SKTextures from SKTextureAtlas's also support this feature (since they're essentially a bit different in nature). I ask the question because it's actually hard to see if anything is getting mipmapped from the results. 回答1: First off a SKTexture from a SKTextureAtlas does not support mipmapping. Secondly sometimes mipmapping doesn't even work with

SpriteKit SKTextureAtlas, Terminated Due to Memory Pressure while loading texture

本秂侑毒 提交于 2019-12-23 03:33:12
问题 Similar to the SpriteKit Featured Game "Adventure" from WWDC, I am try to load my background image via tiles. I have created a Texture Atlas that contains 6,300 "tiles" that are each 100x100 pixels in size. The complete background image is a total of 30,000x2048 (for retina displays). The idea is that the background will move from right to left (side-scroller). The first column and the last column match so that they seem continuous. When the application runs, it loads my initial loading

CUICatalog: Invalid Request: requesting subtype without specifying idiom (Where is it coming from and how to fix it?)

穿精又带淫゛_ 提交于 2019-12-22 01:24:53
问题 When I run my SpriteKit game, I receive this error multiple times in the console. As far as I can tell (though I'm not completely sure), the game itself is unaffected, but the error might have some other implications, along with crowding the debug console. I did some research into the error, and found a few possible solutions, none of which seem to have completely worked. These solutions include turning ignoresSiblingOrder to false , and specifying textures as SKTextureAtlas(named: "atlasName

Sprite Kit animateWithTextures lags

ぃ、小莉子 提交于 2019-12-19 04:22:37
问题 I'm using texture atlases in my Sprite Kit game. I'm creating SKTextureAtlas object and store it's textures in array for each animation. So when I need some animation on my hero I call animateWithTextures sending it the corresponding array. There are some lags when I start animations. Is there some way to start animation smoothly? 回答1: I am sure there are few ways to get around this. What you need to do is to preload an atlases before your gameplay actually start. Just show a loading screen