In swift how do I change the color of a SKSpriteNode?

后端 未结 2 2016
心在旅途
心在旅途 2021-02-05 15:43

I have created a game with an SKSpriteNode that is black and when the user touches the screen I would like for the SKSpriteNode to change to white. I h

2条回答
  •  眼角桃花
    2021-02-05 15:49

    Copying an answer found on another forum:

    The black parts of your image won't be blended, I can't see what the alpha is from your image, but if your image was just a black outline with a solid white center, if you blend, you'll see the color. If you want just the outline to blend, you need to create a white outline. With blending, you can set color to blend to black, but you can't blend to white.

    link: https://www.reddit.com/r/swift/comments/30hr88/colorizing_a_skspritenode_doesnt_seems_to_work_as/

提交回复
热议问题