I'm trying to colorize a spriteNode (in this case its named background) using sprite kit but cant get the color to change. I have a sprite that I want to colorize. I'm changing the color property of the sprite as well as the color blending factor. When I run the app nothing happens though. the color remains the same (its black right now). below is the code I'm using to change the color:
background.anchorPoint = CGPointMake(0, .5);
background.position = position;
// ...
// this does not seems to be doing anything at all
background.color = [SKColor redColor];
background.colorBlendFactor = 1.0f;
did I miss something? I read through the docs and it seems like a pretty simple process. I believe all I need were those 2 lines, but it doesnt have any effect. Does anyone know why this would not be working? The texture image has a lot of transparency, could that be causing the issue? Ive tried this on different sprites and it never works.
Something like this:
Should definitely tint the sprite of choosing. The thing is that this is non intensive blend. Using a CIFilter with an SKEffectsNode is very very intensive for such a simple task.
I have an example below that blends a sprite with a red tinting, making the the sprite red tinted rather it's original color of orange:
I would also like to point out that this class is a subclass of SKSpriteNode.
Attached below is an example where I've applied the red tint using the exact code above.
Raywenderlich has a nice quote describing blending effects: