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

105 Views Asked by At

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.

0

There are 0 best solutions below