An SKShapeNode object draws a shape defined by a Core Graphics path
Questions tagged [skshapenode]
286 questions
0
votes
1 answer
iOS Sprite Kit SKShapeNode does not fill entire path
Issue: A SKShapeNode sometimes doesn't draw the entire path. If it's moving each frame some frames it doesn't draw. In my real case scenario I'm using a very complex 10+ sided shape but for this demo I'm just doing a triangle. See screenshots for…

ndomin
- 428
- 4
- 11
0
votes
0 answers
Detect collisions on multiple SKShape Nodes
In SpriteKit I have a ball class of type SKShape node, and in that class is a method to change the fillColor of the node (only SKShape node has the fillColor property) and In my game I want multiple balls to launched every few seconds. My problem is…

evanlws
- 93
- 1
- 12
0
votes
1 answer
Anchorpoint on SKShapeNode or something else
I can't figure out how to make the anchorpoint in my SKShapeNode that is probably set to (0.5,0.0) to (0,0) since when my game draws the path the coordinate system is not working right...
Thanks for the help

GKTon
- 61
- 5
0
votes
1 answer
SKShapeNode dealloc EXC_BAD_ACCESS
I'm having some strange problems with sprite kit throwing up when trying to destroy an SKShapeNode. The image below is an extract from the stack trace.
Has anyone seen this before? I don't seem to get this problem when using SKSpriteNodes (i.e.,…

Pinxaton
- 437
- 4
- 13
0
votes
0 answers
No colision detection with edges when panning node fast
Im freaking out with this collision issue:
panned ball breaks out edgeloop body when panned fast. Anyone had simillar problem?
Here is scene code ilustrating the issue.
(Replacement MyScene in xcode sample - spritekitgame)
#import "SAMyScene.h"
/*…

Maq
- 369
- 3
- 13
0
votes
2 answers
SKPhysicsBody does not work on SKShapeNode
I am drawing a ShapeNode using UITouch as below:
The line draws correctly. However, my problem is with adding the physicsbody to the shapenode(I want a SKSpriteNode to collide and bounce). But it's as if the physicsbody never attaches to the…

Doug
- 169
- 1
- 2
- 12
0
votes
0 answers
Binding SKShape node to the CGPathGetCurrentPoint
I try to bind SKShapeNode to CGPathGetCurrentPoint of my circle. But it seems that path is not moving.
CGPoint d;
...
myPath = CGPathCreateMutable();
CGPathAddArc(myPath, NULL, 0,0, 60, 10, M_PI*2, YES);
arc = [SKShapeNode node];
arc.path =…
0
votes
1 answer
SKSprite following CGMutablePath alignment
I'm confused on what is going on here. I know its supposed to be some coordinate shift, but when I use a circle for the path it traces it exactly. If I use a curve as below this is the result I get. I just want to draw the curve then have a…

Cherr Skees
- 1,508
- 2
- 21
- 37
0
votes
2 answers
Draw the Path of a Moving SKSpritenode
I am Trying to use the new SKSpritenode , i have managed to create a Spritenode move it around the screen , although i want the Spritenode leaves a trace( color ) where it moves.
the code to create the Sprite node & my attempts to create a…

TALAA
- 6,184
- 1
- 13
- 21
0
votes
2 answers
Sprite Kit/ SKShapeNode: excluding overlap of shapes
I'm trying to create a crescent moon effect by using two overlapping circles. My thinking was that I could subtract one from the other, but I'm having trouble executing it.
Here's how I've coded the paths (the second path is overlaps the first one…

MassivePenguin
- 3,701
- 4
- 24
- 46
-1
votes
1 answer
SKSpriteKit: reposition nodes on changing size when device is rotated
I am using SpriteKit to present several boxes (SKShapeNodes) with texts inside, like this:
Then I rotate my device anticipating that the boxes will retain their original position no matter what the orientation is, but get this instead:
Can…

Igor Tupitsyn
- 1,193
- 3
- 18
- 45
-1
votes
1 answer
Use of unresolved identifier 'path' SKShapeNode
I am trying to create a constant using SKShapeNode. I have this 1 error kicking my ass for the last hour. Please help me out, I will appreciate it.
import SpriteKit
class GameScene: SKScene {
override func didMove(to view: SKView) {
…

Solomon Reese
- 3
- 2
-1
votes
1 answer
SKShapeNode subclass frame element is referencing UIView instead of SKNode
let dx = line.frame.midX - other.frame.midX
produces the following exception:
Ambiguous use of operator '-'
Here is the line & other class' object type declaration:
import Foundation
import SpriteKit
class Line: SKShapeNode {
var…

sdc
- 2,603
- 1
- 27
- 40
-1
votes
1 answer
UIColor(r: g: b:) not working properly
I have a method called drawLine(), that draws a line between two points (obviously). It has a start point and an end point that are constantly being moved around, so everytime the update() method is called, the line is deleted, and drawLine() is…

Lahav
- 781
- 10
- 22
-1
votes
2 answers
SpriteKit Lagging on iPhone 5 but not on iPhone 6
I have been working on my first SpriteKit game that perfectly works on iPhone 6 but not on iPhone 5 (iOS 8.2 on both, written in Swift). I explain my problem: there is a simple ball (a SkShapeNode) that bounces when tapping on the screen. The move…

Jonathan
- 11
- 4