Initializer

init(texture:normalMap:)

Initializes a textured sprite with a normal map to simulate 3D lighting.

Declaration

convenience init(texture: SKTexture?, normalMap: SKTexture?)

Parameters

texture

A SpriteKit texture used to draw the sprite.

normalMap

A SpriteKit texture used to add lighting behavior to the sprite.

Return Value

A newly initialized sprite object.

See Also

Creating a Sprite from a Texture

init(texture: SKTexture?)

Initializes a textured sprite using an existing texture object.

init(texture: SKTexture?, color: UIColor, size: CGSize)

Initializes a colored and textured sprite using an existing texture object.

init(texture: SKTexture?, size: CGSize)

Initializes a textured sprite using an existing texture object but with a specified size.

var texture: SKTexture?

The texture used to draw the sprite.