I have a Swift 4.2 SpriteKit scene and I want to programatically change the texture of an SKSpriteNode. How do I access the SKSpriteNode contained in the SKNode to change the texture? Here is my code:
@IBOutlet weak var spritekitsceneFG: WKInterfaceSKScene!
var SpriteTick1 = SKNode()
SpriteTick1 = (spritekitsceneFG.scene?.childNode(withName: "SKSpriteTick1"))!
Want to change texture here!
print(SpriteTick1)
Printing out the SKNode gives the following output:
<SKSpriteNode> name:'SKSpriteTick1' texture:[<SKTexture> 'tick' (64 x 64)] position:{-48.000137, -56.000198} scale:{1.00, 1.00} size:{48, 48} anchor:{0.5, 0.5} rotation:0.00
I want to be able to programatically change the texture here, the texture is called 'tick'