I have a problem creating SKSpriteNode with UIImage. I create assets that I use for my application with PaintCode (PaintCode creates a Swift file with drawing methods and image methods that allow me to display the created images).
Now my problem is that I want to create a simple SKSpriteNode using my PaintCode images, but I don't know how to add them to SpriteNode.
I tried something like this (line 18):
let Bottom = SKSpriteNode(texture: SKTexture(image: StyleKitName.drawBottom(frame: CGRect(x: 50, y: 50, width: 50, height: 50), isWinter: false)))
But it returns the following error:
/Users/myMacName/Documents/App Development/AppName/AppName/GlobalFunctions.swift:18:44: Cannot find an initializer for type 'SKTexture' that accepts an argument list of type '(image: ())'
The StyleKitName.drawBottom function returns a UIImage. It would be nice if someone could tell me how to create an SKSpriteNode with UIImage.
I appreciate any help. Thanks.
source share