An SKShapeNode object draws a shape defined by a Core Graphics path
Questions tagged [skshapenode]
286 questions
47
votes
7 answers
How to draw a line in Sprite-kit
How can one draw a line in Sprite-kit? For example if I want to draw a line in cocos2d, I could easily using ccDrawLine();
Is there an equivalent in sprite-kit?

Waruna
- 1,174
- 1
- 9
- 20
31
votes
1 answer
Sprite Kit - SKShapeNode Path not drawing Quad Curve
I have been delving in to Apple's new Sprite Kit, and been using it for a while now.
However I ran into an issue when trying to draw a curved path for an SKShapeNode. It just appears to draw a straight line instead.
Here is a very simple example of…

David Williames
- 1,109
- 9
- 11
29
votes
5 answers
How to draw a circle in swift using spriteKit?
I just started doing ios development with swift and I can't figure out how to draw a circle. I'm just trying to draw a circle, set it to a variable and display in on the screen so I can later use it as the main player. Could anyone tell me how to…

elpita
- 1,085
- 3
- 12
- 13
17
votes
2 answers
no designated init for SKShapeNode(circleOfRadius: radius)
I'm trying to create a subclass of SKShapeNode in swift as SKShapeNode(circleOfRadius: radius) but there is no designated init for it.
Anyone have any workarounds or info about why? I'm not sure if this is a bug or intentional. I found this…

Chris
- 173
- 1
- 6
17
votes
1 answer
Why SKShapeNode does not have anchor point?
i am trying to understand why SKShapeNode does not have an anchor point ?

Sureyya Uslu
- 325
- 4
- 10
15
votes
1 answer
How to cut random holes in SKSpriteNodes
Aside from the fact that the question asked here : Draw a hole in a rectangle with SpriteKit? has not satisfactorily been answered in its own right, the most significant difference between the two is that this question requires an absence of…

Confused
- 6,048
- 6
- 34
- 75
13
votes
3 answers
Poor performance with SKShapeNode in Sprite Kit
I'm making a "Achtung die kurve"-clone in Sprite Kit. For the constantly moving lines/players I'm using A CGMutablePathRef along with an SKShapeNode. In the update method I'm doing this
// _lineNode is an instance of SKShapeNode and path is…

oyvindhauge
- 3,496
- 2
- 29
- 45
11
votes
1 answer
How to animate the opacity of a SKShapeNode?
I am working on the instructions screen of my game and want to show to the user that they should tap a certain area of the screen.
So I want to show an animation where
1) A finger is scaling in and out of the screen, followed by -- working…

Has
- 885
- 4
- 13
- 31
11
votes
2 answers
How to set a lineWidth less than 1 for SKShapeNode?
I'm trying to make an SKShapeNode with a very think stroke (like 0.25 pixel). It seems that lineWidth of 1 is the smallest I can go, at least that's what it looks like on screen no mater what value less than 1 is set.
SKShapeNode…

user2887097
- 309
- 4
- 12
9
votes
1 answer
How To Implement A Circular Loader without SKShapeNode
I want to creat a simple circular loader animation circle and border around it which is disappearing
I found great frameworks but they use SKShapeNode and SKShapeNode performance is terrible for actual deployed app
ProgressNode: Very cool framework

grape1
- 759
- 2
- 8
- 19
7
votes
1 answer
SpriteKit - Animate SKShapeNode Shape Path
Currently I am using Core Graphics for a shape and to transform the shape in to a different one with CAShapeLayer and CABasicAnimation path animation.
However due to the complexity of the game, If were to step in to SpritKit, using SKShapeNode,…

Gizmodo
- 3,151
- 7
- 45
- 92
7
votes
1 answer
Swift 3 (SpriteKit): Changing the alpha value of the parent which affects all children
Say for instance I create SKShapeNode and create children for it (an example is a cross and its two intersecting lines). The cross is the parent, and the intersecting lines are the children. How could you change the alpha value of all the parent's…

J.Treutlein
- 963
- 8
- 23
7
votes
1 answer
SKShapeNode filltexture() does not display image
I want to create a circle that whose content is an image (.png), and based on the SKShapeNode class reference, I thought that I could use SKShapeNode.filltexture() function to set the texture to the image. But when i run the code below, I get the…

malena
- 798
- 11
- 26
7
votes
3 answers
Confusion about coordinates, frames & child nodes in SpriteKit on iOS?
I'm still playing around with learning SpriteKit in iOS & have been doing lots of reading & lots of experimenting. I'm confused by something else I've found* regarding coordinates, frames & child nodes.
Consider this snippet of code, in which I'm…

WonderMonster
- 220
- 3
- 9
7
votes
4 answers
Rotating an SKShapeNode along its center
I have an SKShapeNode (rectangle in this case) which I am trying to rotate along its center. However it is rotating along the screen's bottom left point. Since I cannot set an anchor point for SKShapeNode, how can I achieve my requirement (to rotate…

Bijoy Thangaraj
- 5,434
- 4
- 43
- 70