An SKShapeNode object draws a shape defined by a Core Graphics path
Questions tagged [skshapenode]
286 questions
2
votes
1 answer
Creating a Circle With Arcs, Using UIBezierPath (Images Included)
I'm using SpriteKit and trying to achieve the following effect using arcs
I created three SKShapeNodes and assigned UIBezierPath's CGPath property to the SKShapeNode's path property..
Here is my code:
func createCircle(){
//container contains…

NSHippie
- 53
- 5
2
votes
1 answer
SKShapeNode .strokeColor to look same as .fillColor when change node.alpha
When I change SKShapeNode's .alpha, its stroke shows itself as if .strokeColor of node was brighter than its .fillColor. Setting .lineWidth to 0 canceles antialiased smotheness that the stroke provides. Same does setting .strokeColor to…

kerd
- 307
- 2
- 13
2
votes
0 answers
Keep relative positions of SKSpriteNode from SKShapeNode from CGPath
I have an array of array of coordinates (from a shapefile), which I'm trying to make into a series of SKSpriteNodes.
My problem is that I need to keep the relative positions of each of the shapes in the array. If I use SKShapeNodes, it works, as…

Gerome Pistre
- 457
- 6
- 15
2
votes
1 answer
SKShapeNode problems on SKScene transition
I am having this weird problem with my game menu when I use SKShapeNodes instead of SKSpriteNodes. The menu is basically a subclass of SKNode and just has different SkSpriteNodes as buttons, its pretty straight forward.
Recently I changed the…

crashoverride777
- 10,581
- 2
- 32
- 56
2
votes
2 answers
Add sprite to other sprite position
I have two body
SKShapeNode *hero = [SKShapeNode shapeNodeWithCircleOfRadius:HERO_SIZE];
hero.lineWidth = 1;
hero.fillColor = [SKColor orangeColor];
hero.name = @"Hero";
hero.physicsBody = [SKPhysicsBody bodyWithCircleOfRadius:HERO_SIZE];
…

pVaskou
- 163
- 1
- 9
2
votes
1 answer
Creating a subclass of SKShapeNode
class ColorRectangle: SKShapeNode {
var width: CGFloat!
var height: CGFloat!
var rectColor: UIColor!
convenience init(rectOfSize: CGSize, colorOfRectangle rectColor: UIColor) {
super.init(rectOfSize: rectOfSize)
…

Lalit Prabhu
- 73
- 4
2
votes
2 answers
Merge SKShapeNode and SKLabelNode
I would like to merge an SKShapeNode and an SKLabeNode to make only one node
Here is my "Bloque" class who drawn an rectangle and add a sklabelnode child on it:
class Bloque : SKShapeNode
{
var color : String!
var numero : Int!
var type…

Xakaa
- 23
- 2
2
votes
1 answer
Drawing a Line that Changes Direction
I currently am attempting to make an app that consists of a line that goes straight up, but when the screen is tapped it changes at a 45 degree angle (To the left or right).
I'm creating the path for this like so:
var path =…

Aaron
- 757
- 5
- 18
2
votes
1 answer
Custom SKShapeNode Child Not Appearing
I am trying to make a number appear in the middle of an SKShapeNode. However, for some reason when I add the SKLabelNode as a child of the shape node, it does not appear despite the fact that the SKShapeNode does appear. I added the same label as a…

Kendel
- 1,698
- 2
- 17
- 33
2
votes
1 answer
SKNode frame incorrect?
This is the constructor for my NumberTile class:
class NumberTile: SKShapeNode {
var tileColorArray = NSArray(objects: "#996666","#a65959","#b34d4d","#bf4040","#cc3333","#d92626","#e61919") //red
init(xPos: NSInteger, yPos:…

Siu Chung Chan
- 1,686
- 1
- 14
- 31
2
votes
1 answer
How to add SKShapeNode to random position until screen getting full
I want to add SKShapeNode to random position, using Sprite Kit, until the screen getting full.
How can I find the empty space in screen?

nmokkary
- 1,219
- 3
- 14
- 24
2
votes
1 answer
EXC_BAD_ACCESS Error for SKTexture from textureFromNode With Swift 1.2
I've just encountered an error I haven't been able to solve. I get a EXC_BAD_ACCESS (code=1, address=0x30) failure when my SpriteKit scene is loading up.
In viewWillAppear(...) my Game View Controller calls the loadGame(...) function:
private func…

Mason
- 271
- 2
- 12
2
votes
2 answers
SpriteKit Memory Leak
After profiling my app, I appear to have a memory leak somewhere in this method:
- (void) didEvaluateActions {
for (int x = 0; x < self.children.count; x++) {
if ([self.children[x] isKindOfClass:[BallNode class]]) {
BallNode * ball =…

Jake
- 13,097
- 9
- 44
- 73
2
votes
2 answers
Sprite Kit: How to create infinite game background like 'Binary Rush' or 'Stay in the line'?
I want to create an infinite game background like 'Binary Rush' or 'Stay in the line'. The background could be a simple track. It's sort of like a random racing road track.
Currently I have used a single SKShapeNode to draw the path, and just set…

artekr
- 23
- 3
2
votes
0 answers
SKShapeNode disappears when updating path
I initially draw a line with an SKShapeNode.
var path = CGPathCreateMutable()
p0 = CGPointMake(-(self.frame.size.width/2), 100.0)
CGPathMoveToPoint(path, nil, p0.x, p0.y)
p1 = CGPointMake(self.frame.size.width/2, 100.0)
…

Johnston
- 20,196
- 18
- 72
- 121