A very very raw example
Just think about a UIImage
and a UIImageView
in UIKit. The first one is an image while the second is a UI element that can be added to a view (at a given position) and can store an image. Something similar happens with SKTexture
and SKSpriteNode
.
SKSpriteNode
It is first of all an SKNode
.
It has a position
, a rotation
angle, a scale
factor and a bunch of other properties included an SKTexture
. You can add an SKSpriteNode
as child of your GameScene
(subclass of SKScene
) or of another node inside the scene.
If the SKSpriteNode
is added to the scene, the SKTexture
associated to it is rendered on the screen according to the geometrical transformation applied to the SKSpriteNode
(position, rotation, scale, etc...).
If the SKSpriteNode
is over the screen boundaries or is covered by another graphics element the associated texture is not rendered on the screen.
An SKSpriteNode is a node that draws a textured image, a colored square, or a textured image blended with a color. You can also provide a custom shader to create your own rendering effects.
SKTexture
Basically it is an image in bitmap format. Infact you can create an SKTexture
using a UIImage
and you can it to an SKSpriteNode
.
A SKTexture
has NOT a position, a rotation angle or many other properties you can find into a SKSpriteNode
. It simply an image.
An SKTexture object is an image that can be applied to SKSpriteNode [...]. A texture object manages the texture data and graphics resources that are needed to render the image.