iOS SpriteKit How to make stroke color transparent? -


Now I play something simple using the spritekit. There is a problem with the stroke color in the drawing process.

I have to make my colorful shape node transparent, but my stroke color remains the same every time I have tried various techniques to make my node completely transparent: 1) for stroke color Setting alpha component 2) Setting the alpha component to the entire node did not help it, is there any way to get around this or get it?

Build my node

  CGMutablePathRef = CGPathCreateMutable (); CardWidth = cardWidth + Card Alpha; CGPathAddRoundedRect (Arc, NULL, CGRectMake (-Cardview / 2, -CardHight / 2, Cardwidth, CardHight), RoundRadis, RoundRadis); RoundRect = [SKShapeNode node]; RoundRect.name = self.name; CGFloat linewidth = 2.0; CGPathRef strokedArc = CGPathCreateCopyByStrokingPath (Arc, Zero, Linewid, KCG LynePabet, KCGLenzoMeter, // Default10); // 10 limit of the default mixer roundRect.path = strokedArc; [Self-combined: round-piece];  

Then I try to change color and opacity

  roundRect.fillColor = rightcolor; RoundRect.strokecolor = rightcolor; RoundRect.strokecolor = rightcolor; TermLabel.fontColor = rightColor; Roundabout.lafa = 0.5;  

I think the problem is with your path fill color by covering your stoke So that you do not see any change in stroke color. But with my test, node The LLF component should work. This may be the type of iOS version, Apple can work some things together.

There is some code to play with:

  CGMutablePathRef arc = CGPathCreateMutable (); CGFloat cardWidth = 100; CGFloat card height = 170; CGFloat roundreads = 10; CGFloat R, G, B = 1; // Color components CGRCR RECORD = CGRactMake (-CardWid / 2, -CardHight / 2, Cardwidth, CardHight); CGPathAddRoundedRect (Arc, Nouel, Rect, roundradius, roundroads); __block escachepnode * roundpoint = [escache node node]; RoundRect.name = @ "" card "; CGFloat LineView = 20.0; CGPathRef strokedArc = CGPathCreateCopyByStrokingPath (Arc, Zero, Linewidth, KCGLinePabet, KCGLenJoinMeter, // Default10); // 10 Default Miter Range roundRect.path = strokedArc; // roundRect.alpha = 0.3; // if want to use unrelated. [Add View Child: RoundTrack]; // delay SKAction * Waiting Actions = [SKAction waitForDuration: 1 / 15.0f]; // variable constant CGFLOT direction = 1 ; Stable CGFloat speed = 1f; Stable CGFloat alpha = 0; // An action to animate the action SKAction * changeColorAction = [skeleton runblock: ^ {CGFloat vel = direction * speed; CGFloat newValue = alpha + vl; if (newview <0 new = value> 1) {direction * = -1;} and {alpha = New value;} UIColor * newColor = [UIColor colorWithRed: r green: g blue: B alpha: alpha]; // animate size [round cut setstrocler: new color]; // [circular setfilch: new collar]; // Disadvantage to animate}]; // What is the SKAction because it is running the loop at the bottom of the scene. SKAction * seq = [SKAction sequence: @ [waitAction, changeColorAction]]; [Scene Play Action: [Recession Duplication Again: CEC]];  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -