An SKShapeNode object draws a shape defined by a Core Graphics path
Questions tagged [skshapenode]
286 questions
2
votes
1 answer
PaintCode file to SKShapeNode
I could use a few pointers with turning PaintCode files into SKShapeNodes for use in an app I am building. There are two specific issues I am trying to overcome, as outlined below. I am using Xcode 6 beta 4, SpriteKit, Swift and PaintCode for the…

zeeple
- 5,509
- 12
- 43
- 71
2
votes
1 answer
Detecting touches in circular SKShapeNode?
I need to detect touches in a circular shape, the problem is that while the shape looks like a circle the touchable area is still rectangular. How do I detect touches only if the user touches my circle?
This is what I'm doing now:
// Here I add the…

lisovaccaro
- 32,502
- 98
- 258
- 410
2
votes
1 answer
SpriteKit place SKShapeNode in center of scene
I have an ellipse that I want to draw in the center of the scene
let center = (view.scene.position.x, view.scene.position.y)
let size = (view.scene.frame.size.width * 0.7, view.scene.frame.size.height * 0.7)
let ellipse = SKShapeNode…

JuJoDi
- 14,627
- 23
- 80
- 126
2
votes
2 answers
SpriteKit - How do I check if a certain set of coordinates are inside an SKShapeNode?
In my game, I'm trying to determine what points to dole out depending on where an arrow hits a target. I've got the physics and collisions worked out and I've decided to draw several nested circular SKShapeNodes to represent the different rings of…

Astirian
- 63
- 1
- 10
2
votes
1 answer
iOS 7 iPad SpriteKit - Use irregular SKShapeNode as mask for SKCropNode
Does anyone know how to crop an image with spritekit for iOS using an irregular shape node? The problem is when I do an skcrop on it, the shape has 2 layers, and thus the cropping fails. To crop one must use a single layer. Any idea how to rasterize…

rardoz
- 112
- 10
2
votes
1 answer
Using spritekit to create neon coloured shapes
How would you create a realistic neon coloured SKShapeNode? My best attempts involve multiple overlapping shape nodes using successively less glowWidth and increased strokeColor brightness.
This can achieve something like this...
This solution is…

nacross
- 2,013
- 2
- 25
- 37
1
vote
1 answer
The effect displayed by SKShapeNode is different from that of CAShapelayer
I am going to use SKShapeNode to display a Bezier curve graph, but the displayed effect is very strange, and it is not the same as the one displayed by CAShapeLayer. I don't know what is wrong. Does anyone know the problem?
Here is a screenshot of…

iCode
- 13
- 4
1
vote
1 answer
How to draw gradient in SKShapeNode?
I am trying to draw gradient in SKShapeNode object.
I draw a triangle with a color using alpha component and it works fine. And I would like to add gradient so one edge of the triangle disappears slowly to the background. What I want to achieve is…

Marcin Żmigrodzki
- 317
- 1
- 13
1
vote
0 answers
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 applied however varies in intensity as the blades…

andrewz
- 4,729
- 5
- 49
- 67
1
vote
1 answer
How do I convert coordinates in SpriteKit?
I'm trying to grasp the conversion thing in SpriteKit but despite having read the documentation and several posts on SO I can't seem to get it right. As far as I understand there are two coordinate systems that work independently of one another, one…

screenMonkey MonkeyMan
- 393
- 3
- 17
1
vote
1 answer
How to change the fill rule of SKShapeNode when filling color
I'm using SKShapeNode to create a view element which is used in my game, it should be like the following picture, with only 2 visible curves and fill color inside.
Here is my code:
override func sceneDidLoad() {
let shapeNode =…

Burro
- 63
- 5
1
vote
0 answers
Slice an SKShapeNode into two
Is there an easy method to slice an SKShapeNode into 2 seperate SKShapeNodes?
In this example I have created an SKShapeNode using a closed bezier path as well as a single line.
let squareShape = SKShapeNode()
squareShape.path =…

JwL
- 53
- 2
- 7
1
vote
1 answer
Setting non-optional properties in an SKShapeNode subclass
I am trying to create a simple SKShapeNode subclass which contains a label inside it. I've tried a couple of ways to do this but I get errors for both of them.
Attempt 1
class MyNode: SKShapeNode {
private var label: SKLabelNode
init(_…

DanielGibbs
- 9,910
- 11
- 76
- 121
1
vote
1 answer
How to apply a gradient to SKShapeNode created from a path
I am trying to apply a gradient texture to a SKShapeNode created from a path so that the line goes from a solid color to transparent.
This works on a SKSpriteNode but i can't get it to work on SKShapeNode.
Does anyone know a solution for this…

Highly Effective
- 83
- 8
1
vote
1 answer
How to draw a path by touches on a specific path using SKShapeNode in SpriteKit
I make a path using UIBezierPath then from this path I create a SKShapeNode.
I want from the user to draw a same path by his touches on screen to match my original path.
this is the code:
import SpriteKit
import GameplayKit
class GameScene:…

Ammar Ahmad
- 534
- 5
- 24