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 do I remove a texture from a Color Sprite in the Scene Editor?

I want to remove the texture I chose in my colour sprite. But, not replace it with a different texture. Instead I want to just use a colour fill. But I try to delete the texture in the attributes inspector and it just refills the box with the…
Corey F
  • 621
  • 4
  • 14
0
votes
1 answer

Difference between SKTexture and a Sprite in SpriteKit?

im learning about SpriteKit and I dont really understand what is the Differnce between a sprite (SKSpriteNode) and a texture (SKTexture). I know both are images and is it right that "A SKSpriteNode ist a image which is drawn currently and a…
code
  • 33
  • 5
0
votes
0 answers

Set SKSpriteNode with SKTexture inside the Level Editor SWIFT

I have a very large background image. So to improve my game performance, I would like to use Texture asset instead of an Image asset. I use the Xcode 8 level editor, I don't find where set my SKSpriteNode with my Texture in the Attribute…
cmii
  • 3,556
  • 8
  • 38
  • 69
0
votes
1 answer

UImage loads entire SKTextureAtlas instead of just SKTexture

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 =…
John Masiello
  • 149
  • 1
  • 4
0
votes
0 answers

SKTexture size is drastically wrong

When I make a simple texture for a sprite node and put it on scene, it is drastically bigger then the image actually is. Image is of size 25x58. I don't know the actual size on the screen, but looks like 200x200 (probably even more than that!)…
Vladimir Despotovic
  • 3,200
  • 2
  • 30
  • 58
0
votes
0 answers

Swift. Masking a SKTexture on top of a SKSpriteNode

Okay so I have som problems, trying to mask a SKTexture on top op a SKSpriteNode. I've been looking in to SKCropNode, but cant figure it out. (I'm kinda new to this) How can i mask this SKTexture: (This is the image called "Mask") on top of this…
Benja0906
  • 1,437
  • 2
  • 15
  • 25
0
votes
2 answers

how to set duration for individual SKTextures in animation

I am trying to set duration for individual SKTextures in an animation. Below the armsAtlas texture atlas. I would like to set the upTexture to last between 1-4 seconds randomly followed by the downTexture to last between 0.3 - 1 second. How can I…
ErrorFree
  • 83
  • 7
0
votes
2 answers

How to make a node replace another in chronological order?

Lets say I have five dice like so: When I tap, Id like the die face with one dot to replace the one with two dots and (moving the 1 die across the row while moving the other die down the row) and if the last die is at the end, get it to replace the…
0
votes
1 answer

Page Flip Animation For SKTexture?

Is there any way I could animate an SKTexture (lets say its a red square), so that is "peels" from the left to the right like a page, revealing another SKTexture underneath (lets say a blue…
vblaga
  • 35
  • 1
  • 7
0
votes
1 answer

Textures from texture atlas are not loading or appearing

For some odd reason textures from my texture atlas are not loading. I have no idea why. Below is how I typically declare/code a texture -(SKSpriteNode *)background { SKSpriteNode *background; NSArray *backgroundIpad; background =…
RT33
  • 103
  • 9
0
votes
0 answers

How to fill shapes with Texture in a SpriteKit Project

I have a texture which looks likes -> Now I want to create a Sprite which looks like How would I go about doing this in Sprite Kit project?
Bavan
  • 1,021
  • 1
  • 10
  • 24
0
votes
0 answers

sprite kit: imageNamed: or texture:?

I am currently working on a simple 2d sprite kit game. When I created the background "image" object I initialized it using the SKSpriteNode convenience imageNamed: initializer. However, after looking through some of the spriteKit documentation I…
Schanz97
  • 23
  • 3
0
votes
0 answers

Using SKTexture:withImageNamed in a for loop to load animations crashes after playing 30 + animation

My code below creates a Texture from an image name from file lookups in a plist like (Duck1_1,Duck1_2,Duck1_3,etc) it loops through them then adds them to a mutable array. The mutable array is then used to animate with the textures stored and played…
Eric Means
  • 123
  • 1
  • 10
0
votes
1 answer

Is it possible to run code inside of an SKAction sequence that isn't an SKAction?

I have this SKAction sequence: func move(){ let recursive = SKAction.sequence([ SKAction.moveByX(frame.size.width/2.8, y: 0, duration: NSTimeInterval(randomNumber())), SKAction.moveByX(-frame.size.width/2.8, y: 0, duration:…
NickyNick321
  • 213
  • 1
  • 4
  • 12
0
votes
0 answers

How to change the texture atlas of a node in an SKAction sequence?

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