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
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
0 answers

applying masks to SKEmitterNodes

May be some one can give me a hand… I’m trying to add a couple of SKEmitterNodes in their own SKCropNodes. My code: // left emitter node NSString *path = [[NSBundle mainBundle] pathForResource:@"LeftParticle" ofType:@"sks"]; …
Albert Perez
  • 121
  • 5
2
votes
2 answers

Animate masked image in SpriteKit (SKCropNode)

I'm using Sprite Kit to create my first iOS app, and I'm stumbling over what seems to be a pretty basic problem. I'm trying to animate the contents (fillNode) of a SKCropNode (cropNode). The code below sets up the SKScene just fine (I see the…
MassivePenguin
  • 3,701
  • 4
  • 24
  • 46
1
vote
0 answers

SKCropNode doesn't display anything

I can't get SKCropNode to cooperate. I've played with this for HOURS I've copied verbatim hackingwithswifts guide and the only difference being my image and it will not work. So then I dumbed it down for myself with the code below and it still…
ItsSgtMarv
  • 105
  • 1
  • 11
1
vote
1 answer

Masking and Physics in SpriteKit

When using SKCropNode in SpriteKit, does the masking affect the physics of the node? (e.g. I crop half of the sprite, will a ball fall through the masked part of the image?) If this is the case, how would I go about creating the SKCropNode so it…
bwiz
  • 407
  • 5
  • 13
1
vote
0 answers

In Swift/SpriteKit Can you use a ShapeNode as mask in a CropNode

I've been trying to combine randomised SKShapeNode shapes with textures using a SKCropNode but it doesn't seem to work. I assume that SKCropNodes only work with bitmap graphics such as PNG. //define sprite as crop node let cropSprite =…
Kwangle
  • 349
  • 2
  • 15
1
vote
1 answer

Private Boolean: how to set on SKCropNode, with Swift?

SKCropNode works by removing every thing from its affected nodes that are not covered by its source image. This is one type of masking, the other is to invert this logic, and reveal everything that's not covered by the source image. SKCropNode has a…
Confused
  • 6,048
  • 6
  • 34
  • 75
1
vote
1 answer

Can you mask an SKSpriteNode with another SKSpriteNode

Just ask the title asks, I am wondering if this is at all possible. Most examples of the SKCropNode use a texture or a shape. What I want to accomplish is a mask of a custom shape. Let me know if there's a way!
Lyres
  • 343
  • 4
  • 14
1
vote
2 answers

How do I prevent touches from hitting hidden content in SKCropNode?

I'm making pretty heavy use of SKCropNode in my game both for stylistic uses and also in one case where I've built my own SpriteKit version of UIScrollView. I've noticed that when I get a touch event or when a gesture recognizer fires at a certain…
Brent Traut
  • 5,614
  • 6
  • 29
  • 54
1
vote
1 answer

Override function with sprite kit game

I am migrating my game from swift 1 and I can't figure out how to fix this function. I am trying to detect if no touches are taking place, which should keep the ball still. this is the code i have and keep getting error Invalid redeclaration of…
K. Hanoy
  • 13
  • 3
1
vote
0 answers

Swift SKCropNode can someone explain this behavior?

I have a grid of 16 SKCropNode objects. Each contains a SKShapeNode used as a mask, and a SKSpriteNoe. In this image with the mask not set you can see all 16 object appear in a grid. https://github.com/soggybag/Grid Interaction is strange also.…
Mitchell Hudson
  • 1,013
  • 2
  • 10
  • 19
1
vote
1 answer

SKCropNode Strange Behaviour

When using SKCropNode, I wanted the image I add to the cropNode to adjust each individual pixel alpha value in accordance to the corresponding mask pixel alpha value. After a lot of research, I came to the conclusion that the image pixel alpha…
Jarron
  • 1,049
  • 2
  • 13
  • 29
1
vote
1 answer

SKCropNode of SpriteKit: relationship between positions and scales?

I have started programming with SKCropNode. My purpose is to split a given image into smaller pieces (they may be not rectangles later) for a game (in which users have to move those pieces into right positions). The code for studying is simple as…
Tony
  • 1,551
  • 20
  • 21
1
vote
1 answer

What is the meaning of "nonuniformly scaled texture" in SpriteKit?

On SKCropNode class reference, some examples to specify a mask are given. Here they are: This means a crop node can use simple masks derived from a piece of artwork, but it can also use more sophisticated masks. For example, here are some ways you…
Dominique Vial
  • 3,729
  • 2
  • 25
  • 45
1
vote
1 answer

SKCropNode not rendering greyscale mask values in SpriteKit

I have an SKCropNode that is working fine except for one thing - all of the greyscale values in the mask image that are not black or white are getting set to solid white. This means that all greyscale alpha values are not rendering with…
jwade502
  • 898
  • 1
  • 9
  • 22