sktexture

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

SpriteKit - How to fix distortion in Node's animation?

不打扰是莪最后的温柔 提交于 2019-12-20 05:47:24
问题 I have created an animation of various PNGs, but there are various frames that stretch to the border so the node is 'filled'. The animation should look like the GIF that I have created using the same pictures. Does anybody know how to make the animation look like the GIF? GIF: Gif: Animation should look like this Actual: Extra slow Actual result of the code Border: Here you can see the border of the physics body that has the same size of the "node's border" I have tried to fix the problem by

How to compare SKSpriteNode textures

寵の児 提交于 2019-12-20 02:42:28
问题 I am making a game with Sprite Kit. When there is a collision I would like to retrieve the image of the SKSpriteNode that my projectile collided with to assign different point values depending on the image of the monster. I think comparing the texture property of the SKSpriteNode could work. I have tried the following code, but my if statement is never called. Any suggestions? - (void)projectile:(SKSpriteNode *)projectile didCollideWithMonster:(SKSpriteNode *)monster { SKTexture *tex =

Animate an SKSpriteNode with textures that have a size different from the original

牧云@^-^@ 提交于 2019-12-19 10:56:11
问题 I want to animate an SKSpriteNode using textures from an SKTextureAtlas, using SKAction.animateWithTextures(textures,timePerFrame,resize,restore) . However, the textures in the atlas have a size that is slightly larger than the original texture (it's basically a character moving). When the action is run, the textures are either compressed to fit the original size of the sprite, or recentered when I set resize to false , which changes the position of the character. What I want, though, is for

Xcode 9 Crashing while setting a Texture in SKScene in Spritekit

醉酒当歌 提交于 2019-12-18 12:22:42
问题 I am building a game in Spritekit with Xcode currently. After updating to Xcode 9 I've found that every time I set a texture through the .sks file, Xcode crashes instantly. I've restarted my computer, updated the app, reloaded the textures and nothing changed. I have the 2017 Macbook Prof 13" w/ touch bar. Here are the diagnostics: Process: Xcode [577] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 9.0.1 (13249) Build Info: IDEFrameworks

How does SKTexture caching and reuse work in SpriteKit?

冷暖自知 提交于 2019-12-17 23:46:54
问题 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? 回答1: Texture Caching in SpriteKit “Long story short: rely on Sprite Kit to do the right

Sprite Kit OS X: SKTexture size property is incorrect

前提是你 提交于 2019-12-17 19:46:38
问题 I'm testing a game on the OS X version of Sprite Kit, and find that some textures report their size incorrectly. I'm wondering if anyone else is seeing this problem and whether there is an explanation for it? Just to rule out any other issues before I report this as a bug. If this is a known bug, please say so. I'm loading this texture, it is 256x256 pixels in size: When I log the SKTexture created from this image, then the SKTexture description gives me the correct size but the size property

SKTexture nearest filtering mode doesn't work (Making Pixel Art)

心不动则不痛 提交于 2019-12-12 09:39:44
问题 I used a relatively small image (44pixel tall) and scaled it up to have a pixel art look. I tried to change the filtering mode to nearest so the anti-aliasing would disappear but it didn't. It appears with blurry edges. I tried the same with a background getting the same result. let myNode = SKSpriteNode() class GameScene: SKScene { func makeNode() { myNode.position = CGPoint(x: self.frame.size.width/2, y: self.frame.size.height/2) myNode.size = CGSize(width: 200, height: 200) myNode.texture

SKTexture from UIImage looks different

橙三吉。 提交于 2019-12-12 01:13:18
问题 I'm playing around with SpriteKit and I'm creating a SKTexture from an UIImage, then using SKSpriteNode to add the child to my SKScene (As a background), everything works fine, except that the UIImage looks very different from the original image, I tried to recreate the image in photoshop and the issue still remains, tested on Simulator and real device and different image colors, no changes. The image format is PNG, and I added through Images.xcassets in Xcode 5 Image, results: Different

SpriteKit: Using SKTextureAtlas causes incorrect Physics Body

核能气质少年 提交于 2019-12-11 13:23:41
问题 I am building my first sprite kit game, and recently read an article that said to use SKTextureAtlas to improve performance. So I migrated all my sprite images into organized .atlas folders and updated the code accordingly. However, now my sprites have weird physics bodies (mainly over-enlarged) . For instance, my player sprite has three states: Flying (flat), Flying Up and Flying Down. The three images are pretty similar, with slight variations (arms pointing flat, up, down) . Before