Wang Ying
Wang Ying

Reputation: 25

how to add a white color as a filter on a SKSpriteNode in Swift

I have added a SKSpriteNode in the scene, and I want to add a white color on it to brighten.

let armySprite = SKSpriteNode(imageNamed: "army_img")
armySprite.position = tile.Position
scene.addChild(armySprite)
armySprite.colorBlendFactor = 1
armySprite.color = .white

However, there is nothing happened. So, how can I add a white color filter on armySprite to make it more bright?

The original img is like this: enter image description here

Then, what I want is like this : enter image description here

Thanks.

Upvotes: 1

Views: 105

Answers (0)

Related Questions