skcropnode

How to cut random holes in SKSpriteNodes

本小妞迷上赌 提交于 2019-11-30 17:33:39
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 workarounds and specifically asks about reversing the functionality of SKCropNodes. The primary concerns in this question cannot be addressed by the type of hacky ways the above question could be answered due to the randomness of the holes, the number of holes, and the variation in objects to which the holes are to be applied. Hence the Swiss Cheese

How to cut random holes in SKSpriteNodes

穿精又带淫゛_ 提交于 2019-11-30 01:15:05
问题 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 workarounds and specifically asks about reversing the functionality of SKCropNodes. The primary concerns in this question cannot be addressed by the type of hacky ways the above question could be answered due to the randomness of the holes, the number of

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

时光毁灭记忆、已成空白 提交于 2019-11-29 18:53:01
问题 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 ]init]; CGMutablePathRef circle = CGPathCreateMutable(); CGPathAddArc(circle, NULL, CGRectGetMidX(self.frame), CGRectGetMidY(self.frame), 50, 0, M_PI*2, YES); circleMask.path = circle; circleMask.lineWidth = 0; circleMask.fillColor = [SKColor blueColor];