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
0
votes
1 answer

How to use .xscale that runs depending on which way node is moving?

I'm making a game with SpriteKit where I have a node that is repeatedly moving back and forth from the left to the right side of the screen using this SKAction sequence: func move(){ let recursive = SKAction.sequence([ …
NickyNick321
  • 213
  • 1
  • 4
  • 12
0
votes
2 answers

SpriteKit texture duration

I am making a game and I have a node that switches back and forth between 2 textures. I was wondering how I can add a 0.5 second duration for each texture before it switches back to the previous one. Right now when I run the game the textures switch…
NickyNick321
  • 213
  • 1
  • 4
  • 12
0
votes
0 answers

SKMutableTexture for SKPhysicsBody. No collisions are occuring.

I'm using AVFoundation to grab live camera feed, process the pixels into an alpha mask image, then trying to use that image to create collision boundaries in my SKView. Balls will bounce off of the boundaries in this node. Kind of an augmented…
VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80
0
votes
1 answer

Error loading particle texture in Spritekit?

My particle texture is correctly showing in the particle system, in SpriteKit. But once the app is started, the image is not recognized : SKTexture: Error loading image resource: "XP.png" I tried to add the image in Images.xcassets, but it is not…
Paul
  • 6,108
  • 14
  • 72
  • 128
0
votes
1 answer

How do I circumvent this nasty SKTexture bug?

Upon launch of my iOS SpriteKit project, I preload some sprites in the background. Every 10th approach or so fails with an NSGenericException within main. I am suspecting [SKTexture loadImageData] to be the directly linked with the problem, since it…
Double M
  • 1,449
  • 1
  • 12
  • 29
0
votes
1 answer

Can't reliably verify texture for SKSpriteNode

I am trying to write a test that verifies a SKSpriteNode in my scene has the correct texture. The test looks like this: let sceneSprite = scene.childNodeWithName("sceneSprite") as SKSpriteNode! let sprite = SKSpriteNode(imageNamed:…
Tron Thomas
  • 871
  • 7
  • 20
0
votes
0 answers

should I cache textures in properties in sprite kit?

I am using atlases for the image assets in my game. I am preloading all my atlases at the beginning of my Game Scene with SKTextureAtlas preloadTextureAtlases which made a big difference when I started using it. Here is my question: Should I create…
Gadget Blaster
  • 759
  • 5
  • 15
0
votes
1 answer

best way to present images in SpriteKit

I have been using SpriteKit for a year now, and am very comfortable with it. However much of what I do is habitual, and I am not necessarily sure of why I do some things. My images are all sorted in texture atlases, but there appears to be 3…
Ron Myschuk
  • 6,011
  • 2
  • 20
  • 32
0
votes
1 answer

SpriteKit texture change according to sprite x-axis direction

This seems like a simple problem to solve, yet I can't. As the title suggests, I need my sprite to change to a different texture depending on which way it's going - left or right. Here's what I tried doing: if (self.sprite.position.x > 0) //also…
Krekin
  • 1,516
  • 1
  • 13
  • 24
0
votes
1 answer

Unable to filter textures from texture atlases in SpriteKit

I am having a very annoying issue... I have a game with pixel-based art, so the textures used are 8x8 and then scaled up to 128x128 or whatever is needed. To do this, all I need to do is say texture.filteringMode = SKTextureFilteringNearest Now that…
IAmTheAg
  • 351
  • 3
  • 11
0
votes
1 answer

SKTextureAtlas Filtering Nearest Neighbour

I have a SKTextureAtlas which contains a list of SKTextures, but the problem is that whenever I load the SKTexture from it and state that the filtering on it is SKTextureFilteringNearest, it filters it Linear! I have that problem only on iOS lower…
enisdenjo
  • 706
  • 9
  • 21
0
votes
0 answers

Play button takes a long time to enter MyScene

SKSpriteNode *play = (SKSpriteNode*)[self childNodeWithName:@"play"]; CGPoint location = [touch locationInNode:self]; if([play containsPoint:location]) { SKScene *PlaneScene =[[abMyScene alloc]initWithSize:self.size]; …
0
votes
0 answers

SKSpriteNode takes too much time to be created from texture

I have a field full of sprites (30x30). Before creating any sprite I am preloading my texture atlas with this code: - (void)preloadAllAtlases { BGLog(); _tilesAtlas = [SKTextureAtlas atlasNamed:@"Tiles"]; _tilesTextures =…
AndrewShmig
  • 4,843
  • 6
  • 39
  • 68
0
votes
1 answer

CIFilter (CIStripesGenerator) with SKTexture?

I am trying to get a strips generated using CIFilter, then create a SKTexture from it. Here is my code. CIFilter *filter = [CIFilter filterWithName:@"CIStripesGenerator"]; [filter setDefaults]; [filter setValue:[CIColor colorWithRed:1…
walaa
  • 23
  • 4
0
votes
3 answers

Cannot use and found setTexture:resize SpriteKit

i have a problem with texture in SpriteKit game: in touchesBegan i do: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInNode:self]; SKNode *node =…
Ilario
  • 5,979
  • 2
  • 32
  • 46
1 2 3
9
10