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

How to animate different size of images in iOS7 SpriteKit?

I am using the flowing code to animate my sprite node. NSMutableArray *jumpUpTextures = [NSMutableArray arrayWithCapacity:10]; for (int i = 0; i < 4; i++) { NSString *textureName = [NSString…
Jake Lin
  • 11,146
  • 6
  • 29
  • 40
3
votes
1 answer

How can I run two SKTexture Actions on a sprite node as a group action

I need to run two SKTexture actions on one sprite node. I did the following: func subSprite (_ newSprite:SKNode) { let firstImage = SKTexture(imageNamed: "firstImage") let secondImage = SKTexture(imageNamed: "secondImage") …
IronThrone
  • 242
  • 1
  • 10
3
votes
2 answers

SKEffectNode to an SKTexture?

SKEffectionNodes have a shouldRasterise "switch" that bakes them into a bitmap, and doesn't update them until such time as the underlying nodes that are impacted by the effect are changed. However I can't find a way to create an SKTexture from this…
Confused
  • 6,048
  • 6
  • 34
  • 75
3
votes
1 answer

SKSpriteNode created from SKTexture(data:size:) issues with Alpha (Opacity)

I'm having a problem when creating an SKSpriteNode from pixelData. Below is my code. var pixelData: [UInt32] = [UInt32](count: 256, repeatedValue: 0xff0000ff) pixelData.appendContentsOf([UInt32](count: 256, repeatedValue:…
desperado
  • 213
  • 1
  • 11
3
votes
1 answer

Swift : How to handle a lot of textures in memory

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

Update / Change the image of SKSpriteNode

Is it possible to update/change the image of an SKSpriteNode? The code below does not work: var boss1 = SKSpriteNode(imageNamed: "boss1.png") boss1 = SKSpriteNode(imageNamed: "boss2.png")
Glutch
  • 662
  • 1
  • 6
  • 19
3
votes
0 answers

How to load SKTextureAtlas texture from plist file

I need to load texture images from plist file to be used for SKTextureAtlas. I have made this using the images as frames manually, i. e. run action with textures. But now I have compacted the images in one .png and added their data to the .plist…
Amani Elsaed
  • 1,558
  • 2
  • 21
  • 36
3
votes
1 answer

SpriteKit: How do you highlight a section of the scene, like in a tutorial?

I'm trying to create a tutorial in a game, that goes through parts of the UI and highlights them, whilst dimming the rest of the scene. I think I can do it with Sprites and SKBlendMode, but these are poorly explained in the apple reference…
GilesDMiddleton
  • 2,279
  • 22
  • 31
3
votes
1 answer

How to compare SKSpriteNode textures

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…
MSU_Bulldog
  • 3,501
  • 5
  • 37
  • 73
3
votes
1 answer

Fade between two different SKTextures on SKSpriteNode

Does anyone know if there is a way to fade (over time) between two different SKTextures on an SKSpriteNode. I am assuming that you can't do this directly and plan to use a duplicate child sprite with a higher ZPosition to realise the fade, but I…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
3
votes
1 answer

Does a SKTexture from a SKTextureAtlas support the mipmap feature?

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…
Theis Egeberg
  • 2,556
  • 21
  • 30
3
votes
1 answer

Trying to use only a portion of a SKTexture using textureWithRect inTexture

What I'm doing is create a SKTexture based on the full image SKTexture *fullTexture = [SKTexture textureWithImageNamed:@"fullImage"]; I want to use the full width of the fullTexture, but only a portion of height of the texture, BUT, starting from…
stvn
  • 1,148
  • 1
  • 8
  • 24
3
votes
3 answers

SKTexture get image name

Is there possible to get current image name from SKTexture from SKSpriteNode? I am a new in SpriteKit and I'm writing a little game. I need to detect when ninja will hit enemy. Something like this I am doing SKAction like - (void)setUpHit { …
Roman
  • 366
  • 5
  • 19
2
votes
2 answers

Unable to change the texture of SKSpriteNode

In my game I am creating a Circle object with a certain texture but for example if the Circle hits a certain wall, I want its texture to change. Unfortunately that does not work for some reason and I have no idea why. This is my code for the Circle…
Lenny1357
  • 748
  • 1
  • 13
  • 21
2
votes
0 answers

Swift : How to adjust texture/image to physicsBody's position after changing anchor point?

After changing the anchor point on my SKTexture, my texture now has the desired anchor point, but my physicsBody does not. Before i changed the anchor point they were happy together at the same position. visual This is the only code i wrote…
1
2
3
9 10