Color tint on display group

Is it possible to tint a display group? or apply a blendmode?
I remember there’s a blog about blendmode but I couldn’t find them in the API docs

Thanks [import]uid: 76697 topic_id: 26837 reply_id: 326837[/import]

I don’t think you can directly tint an entire display group. But you should be able to loop through all of the objects in that group and “tint” them in sequence.

for i = 1, theGroup.numChildren do  
 theGroup[i]:setFillColor( r, g, b )  
end  

Note that the values you use for red, green, and blue are “subtractive” from 255,255,255… not additive from 0,0,0. In other words, if you want to tint an object toward green, you set the red and blue values LESS THAN 255 while keeping green at 255.

Best of luck,

Brent Sorrentino
Ignis Design [import]uid: 9747 topic_id: 26837 reply_id: 108998[/import]

Also realize that since you’re subtracting color you will not be able to increase the color on any of the red, green, or blue channels more than it already is, so you can’t make a green character flash red, unless he has a little bit of red in him, and then he’d be flashing mostly reddish black.

To get the flashing or glowing effect on an object you’d have to create a greyscale version of his sprites, then overlay them and play the same animation frames at the same time, on top of the regular character - you’d tint the greyscale overlay sprite and probably set its blendMode to ‘add’, with an alpha less probably somewhere between 0.2 and 0.8- ish.

For glowy effects you want to bleed/fade the edges into the background, your image file will have to contain that gradient alpha in the pixel data itself.

If the game object is already monochrome (but possibly with different grades of light/dark), no overlay is necessary. Just make the sprite greyscale instead and tint to select a color.

[import]uid: 63787 topic_id: 26837 reply_id: 126334[/import]

Also realize that since you’re subtracting color you will not be able to increase the color on any of the red, green, or blue channels more than it already is, so you can’t make a green character flash red, unless he has a little bit of red in him, and then he’d be flashing mostly reddish black.

To get the flashing or glowing effect on an object you’d have to create a greyscale version of his sprites, then overlay them and play the same animation frames at the same time, on top of the regular character - you’d tint the greyscale overlay sprite and probably set its blendMode to ‘add’, with an alpha less probably somewhere between 0.2 and 0.8- ish.

For glowy effects you want to bleed/fade the edges into the background, your image file will have to contain that gradient alpha in the pixel data itself.

If the game object is already monochrome (but possibly with different grades of light/dark), no overlay is necessary. Just make the sprite greyscale instead and tint to select a color.

[import]uid: 63787 topic_id: 26837 reply_id: 126334[/import]