Reputation: 25
Just to be sure about it, if I have a vector image of a ring and I connect it to a node in xCode SpriteKit with: SKTexture *node = [SKTexture textureWithImageNamed:@"ring"]; , what will be the part of that node? Is the node itself the rectangle around the ring (and the hole as well) or does it recognise that the ring's point are the only points on the picture so there is nothing around it and inside the ring?
Upvotes: 0
Views: 101
Reputation: 8130
When you define SKTexture, you're just defining the texture for a node. Make sure you understand the difference. A texture is just an image that you apply to a node. Think of a node as a canvas, and a texture is the paint.
I'm saying this because you write SKTexture *node = [SKTexture....
which leads me to believe you're creating a node, you aren't. youre only creating the texture for a node.
Anyway, that texture will be as large as the size of your image. It will be a rectangle the size of your ring. If your ring is a perfect circle and has a diameter of 10, your texture will be a perfect square with a width and height of 10. Hope that answers your question.
Upvotes: 1