Tag: 中风

iOS SpriteKit如何使笔画颜色透明?

我现在使用SpriteKit做一些简单的游戏。 绘画过程中有笔画颜色的问题。 我必须做我的彩色shapeNode透明,但我的笔触颜色保持不变每次。 我已经尝试了不同的技术来完成我的节点是完全透明的:1)将alpha组件设置为笔触颜色2)将alpha组件设置为整个节点。 它没有帮助。 有什么方法可以实现或解决这个问题吗? 创build我的节点 CGMutablePathRef arc = CGPathCreateMutable(); cardWidth = cardWidth + cardAlpha; CGPathAddRoundedRect(arc, NULL, CGRectMake(-cardWidth/2, -cardHeight/2, cardWidth, cardHeight), roundRadius, roundRadius); roundRect = [SKShapeNode node]; roundRect.name = self.name; CGFloat lineWidth = 2.0; CGPathRef strokedArc = CGPathCreateCopyByStrokingPath(arc, NULL, lineWidth, kCGLineCapButt, kCGLineJoinMiter, // the default 10); // 10 is default miter limit roundRect.path = […]