Tint a sprite to white?

Started by abstauber, Fri 21/03/2014 07:52:50

Previous topic - Next topic

abstauber

Hi,
is it possible to tint a character to solid white? Whenever I try it, the character just turns out kind of desaturated. Tinting to solid black on the other hand is no problem.
[imgzoom]http://i.imgur.com/c6OGpHU.png[/imgzoom]


source sprite
[imgzoom]http://i.imgur.com/QtCjZle.gif[/imgzoom]

Slasher

#1
Hi,

You already asked: http://www.adventuregamestudio.co.uk/forums/index.php?topic=40875.msg540328#msg540328

Tinting to White does not quite do it, I know.

You could make a new player view (player all white), that should do it.. unless there is something I have not seen / read yet...

Good luck ;)



abstauber

Oops - search before you ask. I should have learned that by now :-[

So it's still not possible - well, I'll ask in 4 years again :D

Billbis

You can copy transparency mask from the original sprite into a full white dynamic sprite, then assign this sprite to the character.
I do not have access to AGS right now, so I can't help with the syntax.

abstauber

I think I'll use CopyTransparencyMask to get rid of some transparency effects so I can finally progress to 8 bit 8-)

Thanks!

DoorKnobHandle

Billbis is correct, this is what I did in The Art of Dying when the player or enemies get hit, so you can copy my code from the source! Just search for CopyTransparencyMask!

abstauber

I got it working now.
In case anyone wants to do this too:

Code: ags

    ViewFrame *CurrentFrame = Game.GetViewFrame(player.View, player.Loop, player.Frame);
    DynamicSprite *player_tint = DynamicSprite.CreateFromExistingSprite(377);
    player_tint.Crop(0, 0, Game.SpriteWidth[CurrentFrame.Graphic], Game.SpriteHeight[CurrentFrame.Graphic]);
    player_tint.CopyTransparencyMask(CurrentFrame.Graphic);

SMF spam blocked by CleanTalk