0 Replies
      Latest reply on May 9, 2020 10:09 PM by Aeilot
      Aeilot Level 1 Level 1 (0 points)

        Hello, I started a project using SpriteKit in Playground.
        However, there's an error "Unable to get image data for SKSpriteNode"

        code:

            func createPlayer(){
                player.texture = SKTexture(imageNamed: "nurse.png")
                player.size = blockSize!
                player.position = CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.5)
                player.zPosition = 300
                self.addChild(player)
            }

        My image name is nurse.png, it is correct

        Is there something wrong?