Questions tagged [skcropnode]

An SKCropNode crops the pixels drawn by its children so that only some of the pixels are rendered to the parent’s framebuffer.

An SKCropNode crops the pixels drawn by its children so that only some of the pixels are rendered to the parent’s frame buffer.

SKCropNode is part of , a graphics rendering and animation infrastructure to animate arbitrary textured images, or sprites.

is available on iOS () and OS X ()

42 questions
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
14
votes
3 answers

SKCropNode masking edge anti-aliasing

I created a circular mask and animate a sprite inside the mask by using sprite kit SKCropNode class. But the edge of the mask looks pixellated. Is there a way to use anti-aliasing to smooth the edges?
Rikkas
  • 572
  • 4
  • 19
11
votes
5 answers

Is it possible to use a circle (SKShapeNode) as a mask in Sprite Kit?

I'm trying to create a circular mask in a Sprite Kit project. I create the circle like this (positioning it at the centre of the screen): SKCropNode *cropNode = [[SKCropNode alloc] init]; SKShapeNode *circleMask = [[SKShapeNode alloc…
MassivePenguin
  • 3,701
  • 4
  • 24
  • 46
5
votes
1 answer

SKCropNode fails when I add extra SKNode children in hierarchy

Update: It looks like iOS 10 has fixed this issue. I upgraded to Swift 3 and Xcode 8 and everything is working as expected. I've run into this issue a couple times now and I can't tell if it's a bug in SKCropNode or if I'm just misusing it. Perhaps…
Brent Traut
  • 5,614
  • 6
  • 29
  • 54
4
votes
0 answers

Use an SKShapeNode for the mask of an SKCropNode (Swift)

How can I use an SKShapeNode for the mask of an SKCropNode? My code currently creates an SKShapeNode circle and then sets the crop node mask to it shapeNode = SKShapeNode(circleOfRadius: 50) shapeNode.fillColor = UIColor.red shapeNode.lineWidth =…
E. Huckabee
  • 1,788
  • 1
  • 13
  • 29
4
votes
0 answers

SKCropNode issue

Spent a whole day on this. I don't find this in the iOS docs or on SO. I have a SKShapeNode* that is like a window in my app, and I add a background that is an SKSpriteNode, and the background has another 10 SKSpriteNode as its children. So the node…
Adam
  • 41
  • 2
3
votes
0 answers

SpriteKit SKCropNode cropping wrong area

I am using SpriteKit to draw a graph (with the ability to zoom in and pan around). When I use an SKCropNode to crop the grid of my graph it doesn't crop the desired area. It crops less, no matter if I use a rectangular SKShapeNode or a SKSpriteNode…
ferdyyy
  • 515
  • 4
  • 16
3
votes
2 answers

Swift SpriteKit inverse masking doesn't work on device, but works in Simulator

The code to accomplish this is pretty straightforward: var cropNode = SKCropNode() var shape = SKShapeNode(rectOf: CGSize(width:100,height:100)) shape.fillColor = SKColor.orange var shape2 = SKShapeNode(rectOf:…
OhMyGuin
  • 33
  • 3
3
votes
1 answer

Assign Multiple Masks to SKCropNode

As an example, I have a circle which travels to the left and then the right on the screen. I want the circle to only be visible if it is inside two specific squares (maskNodes). I'm using SKCropNode to try and achieve this, but the SKCropNode mask…
Jarron
  • 1,049
  • 2
  • 13
  • 29
3
votes
1 answer

Making SKLabelNode as a crop node of SKShapeNode

Can't find in web, how to make SKLabelNode cropping SKShapeNode. When i colorize the background, my goal is colorize the label too with the same method, so both of them have to colorize simultaneously. But can't imagine how to crop SKShapeNode with…
2
votes
1 answer

Swift 3: cut a hole in a SKSpriteNode

First of all: I know, that this questions has already many answers here, but they didn't helped me to solve this this problem. I program a little game. At the first launch there is a little tutorial, where bit by bit each element of the game is…
Josef Zoller
  • 921
  • 2
  • 8
  • 24
2
votes
2 answers

Detect touches on SKSpriteNode with oddly shaped image(s) running animations

Using SpriteKit for an iOS 9.0 app/game (and no physics body). I have a few SpriteNodes on a scene. SpriteNodes are with oddly shaped images and runs through multiple frames for animation. What is the best way to detect touches on a SpriteNode's…
ZippyMind
  • 141
  • 2
  • 9
2
votes
0 answers

SpriteKit SKCropNode displays all green on real device IOS 8.3

I'm using a simple SKCropNode with a standard XCode Swift Game Template. Everything works fine in an emulator, but on a real iPhone 4S with iOS 8.3 I see just a green mask (although my shape is red) - no texture sprite is being displayed. The funny…
2
votes
0 answers

Ignore sibling order in Scene Kit overlaySKScene

I am using an overlaySKScene in Scene Kit. In that SKScene, I am using a mask node to crop an SKCropNode. The mask node works perfectly when run on Mac OS X, but when I run it on iOS it doesn't work. I think that's because iOS is ignoring sibling…
2
votes
0 answers

SpriteKit: Determine drawing order for hit test

i am using Spritekit and want to have a hit test, that works intuitive. In other words: I got a position x,y and want to to find out which is the top most node that was hit. (And with "top most" i mean the one that the user actually sees as…
NieLernend
  • 190
  • 9
1
2 3