146 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
84
views
SpriteKit: SKTileMap leaks with `SKTexture(rect: CGRect)` usage
I am facing an issue that I am not able to resolve.
I have been able to create a demo project that demonstrates the issue, which I hope enables you to have a look as well and hopefully find a way to ...
2
votes
1
answer
130
views
Why SKTexture.preload raises memory issue on a real device?
I'm using SpriteKit for a 2D game and have an array of images for a simple animation.
First, I'm creating an array with SKTextures to keep references to those images.
var hyperLeapArray: [SKTexture] ...
1
vote
0
answers
105
views
SKShapeNode fillTexture with rotation
I am having trouble figuring out how the fillTexture property of an SKShapeNode works when rotating that node. In this example I create a fan of 4 rotating blades around the center. The texture ...
1
vote
2
answers
291
views
Is it possible to animate SKTexture with images?
I created a SKEmitterNode and I want the particleTexture property to animate images.
This is what I'm trying, but it is only showing the first image:
let animationImages = [UIImage(named: "image1&...
1
vote
0
answers
41
views
SKTextureAtlas: retrieved texture behaving differently compared to original
I'm having so many problems with SKTextureAtlas I wonder whether it's worth persevering with. It seems to be broken on the simulator, but I'm also running into issues with it on device.
My aim is to ...
0
votes
0
answers
105
views
SpriteKit Problems with cgImage on Xcode simulator but not on device
I am trying to write some code that procedurally creates bitmap fonts, and in order to do that I have been creating SKTextures and then converting them to cgImage / UIImage (because this is necessary ...
0
votes
1
answer
271
views
How to use alpha component in gradient colors with GKNoise and SKTexture?
I'm using GKNoise with a gradient map to generate color noise, getting a CGImage via SKTexture, on Mac OS. In particular I'm using a GKPerlinNoiseSource and setting two gradient colors, at values -1.0 ...
-2
votes
1
answer
64
views
How to get name of object as string in swift 3.0
If my player collides with the drugNode object, I want to change the texture of the animation to the correct image. But I don't know how to get the name of "drugNode". My images are named &...
5
votes
1
answer
443
views
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 ...
0
votes
2
answers
418
views
My SKTexture is size wrong for my SKSpriteNode
I have a 200 x 100 box-like menu button SKSpriteNode declared below.
menuBtn.size = CGSize(width: scrWidth * 1.5, height: 100)
menuBtn.texture = SKTexture(image: UIImage(named: "menuBtn")!)
The ...
0
votes
0
answers
61
views
Problem with Convenience Inits for SKSpriteNodes and assigning Variable values
I've been programming for about 2 years, and as such can usually debug my way out of a certain problem but I can't seem to figure this one out.
I'm currently attempting to make a procedurally ...
1
vote
1
answer
266
views
How to use a SKScene as texture for SCNSphere?
I want to create a sphere of green color with a red point on its surface. One of the most efficient way that I found was to use a SKScene as the texture of the sphere with the desired properties, and ...
1
vote
0
answers
321
views
Corrupt image is displayed by image view when using an atlas texture & calling its cgImage() function
As soon as I updated my iPhone XS Max to 13.2.2 & macOS Catalina to 10.15.1 I returned working on my project & ran it onto my device. Immediately I noticed every UIImageView that was ...
1
vote
0
answers
60
views
SpriteKit SKTextures memory footprint
I have simple background vector image with filesize around 100Kb. When loaded SKTexture, its size is 20Mb.
Known formula for footprint in bytes is width * height * ( 32 / 8 ). Ok, matches.
But
1 ...
0
votes
0
answers
189
views
How do I repeat an animation multiple times simultaneously with respect to performance?
I am aiming to have all these waves animate identically, for performance reasons. This will help by reducing the cost of calculating wave paths, and to reduce the draw count.
I have a scene in ...