Swift Sprite Kit : SKShapeNode of circle

#Swift Sprite Kit# ##SKShapeNode of circle## I has create new circle on the Sprite Kit How to Create circle on Sprite Kit 1. Setup SKShapeNode ``` var newSprit = SKShapeNode() ``` 2. Create circle ``` newSprit = SKShapeNode(circleOfRadius: 25) self.addChild(newSprit) ``` 3. Setup Physicsbody ``` newSprit.physicsBody = SKPhysicsBody(circleOfRadius: 25) ``` Full Code : ``` var newSprit = SKShapeNode() func createNewSprite(point : CGPoint) { newSprit = SKShapeNode(circleOfRadius: 25) newSprit.strokeColor = UIColor.orange newSprit.fillColor = UIColor.orange newSprit.name = "TEST" newSprit.physicsBody = SKPhysicsBody(circleOfRadius: 25) self.addChild(newSprit) } ```

留言

這個網誌中的熱門文章

Easy Triangle Calculator

Powershell transfert UPS Worldship address book to csv file for UPS web import

Swift Sprite Kit easy to create bullet