I am developing a game with a character with some particular shape, I am creating an SKSpriteNode
object with this line:
let rockl:SKSpriteNode = SKSpriteNode(color: UIColor.redColor(), size: CGSize(width: newweight*ancho/16, height: alto/5))
I am assigning a physical body with this line:
rockl.physicsBody = SKPhysicsBody(rectangleOfSize: pipeBotton.size)
and I am assigning the image with this line:
rockl.texture = SKTexture(imageNamed: "character.png")
rockl.texture.filteringMode = SKTextureFilteringMode.Nearest
But the borders are not the same to the border of the image. how can I adjust the object to the image? or whats is the technique to create a custom shape?