ios - making a circular sprite -


I have a small and simple spritekit game that is based on little animation. Basically, the screen gets tapped every time, I want to go out of the place of a circular shape. I now have the following code:

  - (zero) touches: (NSSET *) touches the event: (UEIVEMENT *) event is called when the event is open. / NSLog (@ "touch screen"); (UIT Touch * to touch in touch) {CG point location = [touch space inode: self]; /// NSLog (@ "Location is X% F", location.x); // NSLog (@ "Location is Y% F", location.a); SKSpriteNode * sprite = [SKSpriteNode spriteNodeWithColor: [SKColor purpleColor] Size: CGSizeMake (25, 25)]; Sprite.position = location; SKAction * Action = [SKAK Scale: 10 Duration: 0.5]; SKAction * newaction = [SKAction fadeAlphaTo: 0 Duration: 0.5]; [Phantom run action: Action]; [Phantom Run Action: New Action]; [Add soul to child: phantom]; }}   

This thing is that the shape that is formed when tapping is a square, is there any way i can make it a circle?

Apart from this, whatever work I am doing is the color. I had set the color in purple color to a random color scheme of the group would be correct, but I do not know how to do it.

As I have mentioned in the comment, it is possible with SKShapeNode.

  UIBezierPath * path = [UIBezierPath bezierPathWithArcCenter: CGPointZero Radius: 50 startAngle: 0 endAngle: M_PI * 2 clockwise: true]; SKShapeNode * circle = [SKShapeNode node]; Circle.path = Path. CGPath; Circle.lineWidth = 0; Circle.fillColor = [UIColor redColor];    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -