Questions tagged [sktexture]

An SKTexture object is an image that can be applied to SKSpriteNode objects or particles created by a SKEmitterNode object.

SKTexture is part of , a graphics rendering and animation infrastructure to animate arbitrary textured images, or sprites.

is available on iOS () and OS X ()

145 questions
22
votes
2 answers

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

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…
21
votes
5 answers

UIImage from SKTexture

How to get UIImage from SKTexture? I tried to get UIImage from SKTextureAtlas, but it seems not working too: // p40_prop1 is a part of SKTextureAtlas UIImage *image = [UIImage imageNamed:@"p40_prop1"]; image is nil.
Andrey Gordeev
  • 30,606
  • 13
  • 135
  • 162
12
votes
9 answers

Xcode 9 Crashing while setting a Texture in SKScene in Spritekit

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…
bwiz
  • 407
  • 5
  • 13
11
votes
1 answer

How does SKTexture caching and reuse work in SpriteKit?

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…
Karl Voskuil
  • 750
  • 6
  • 19
8
votes
2 answers

Save generated SKTexture to file

I've now filed a bug for the issue below. Anyone with a good workaround? I try to save an SKTexture to file, and load it back again, but I don't succeed. The following code snippet can be copied to GameScene.m in the Xcode startup project. I use…
Fredrik Johansson
  • 1,301
  • 1
  • 13
  • 26
7
votes
1 answer

SKShapeNode filltexture() does not display image

I want to create a circle that whose content is an image (.png), and based on the SKShapeNode class reference, I thought that I could use SKShapeNode.filltexture() function to set the texture to the image. But when i run the code below, I get the…
malena
  • 798
  • 11
  • 26
7
votes
1 answer

Why does XCode scale Vector images better than Illustrator or Photoshop?

I tried using the new PDF feature of XCode that basically scales the image to 1x, 2x, and 3x. Unfortunately I'm also using Spritekit, so I'd rather use SKTextureAtlases than the Asset Catalog. My problem is that the rasterized version of the pdf…
bricksmart
  • 167
  • 5
6
votes
3 answers

Since iOS9 upgrade SpriteKit images no longer display correctly

I've just updated to iOS 9 only to find that multiple images within my app no longer display. And for some reason, all SpriteKit text is yellow (it was white before). The images in question are 2D sprites, rendered in Sprite Kit, but there doesn't…
Smikey
  • 8,106
  • 3
  • 46
  • 74
6
votes
3 answers

Sprite Kit OS X: SKTexture size property is incorrect

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…
CodeSmile
  • 64,284
  • 20
  • 132
  • 217
5
votes
2 answers

Render SKScene to SKTexture?

Is there a way in Sprite Kit that I can capture the screen (all the current SKScene rendered nodes) to an SKTexture so that I can apply a CIFilter and then assign the SKTexture back to a new SKSpriteNode? I know that I can set an SKEffectNode, as…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
5
votes
4 answers

How to use pixel art in an app?

I have an iOS app that uses sprite kit, and I am ready to add my artwork. The artwork is pixel-art and is inherently very small. I am trying to find the best way to display this in way where: All of the art is the same size, meaning that one image…
67cherries
  • 6,931
  • 7
  • 35
  • 51
4
votes
1 answer

iOS, SpriteKit convert SKTextureAtlas/SKTexture into UIImage

I'm trying to retrieve UIImage from SKTexture where SKTexture comes from an SKTextureAtlas. Which make is harder due to the fact .cgImage() isn't working on Atlases. Anyway, I've came up with solution to use CoreGraphic, however, that seems not to…
Shial
  • 1,386
  • 19
  • 31
4
votes
1 answer

Can SKTextureAtlas load bundle from "my" bundle instead of "host" bundle?

I'm working on a SWIFT3/SpriteKit screensaver and I had the screensaver working except I cannot get my texture to load because when I do the following: // load texture atlas let textureAtlas = SKTextureAtlas(named: "Flyers") The SKTextureAtlas is…
Mavro
  • 571
  • 8
  • 19
4
votes
2 answers

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

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…
4
votes
2 answers

SKTexture from UIImage that respects aspect ratio

I'm setting an image as the background for a SKScene with code similar to the following /* In SKScene subclass */ background = SKSpriteNode() background.anchorPoint = CGPointMake(0,1) background.position = CGPointMake(0,…
Ziewvater
  • 1,413
  • 1
  • 18
  • 33
1
2 3
9 10