DynamicSprite.Tint(int red, int green, int blue, int saturation, int luminance)
Tints the dynamic sprite to (RED, GREEN, BLUE) with SATURATION percent
saturation. For the meaning of all the parameters, see SetAmbientTint.
The tint set by this function is permanent for the dynamic sprite -- after the tint
has been set, it is not possible to remove it. If you call Tint again with different
parameters, it will apply the new tint to the already tinted sprite from the first call.
NOTE: This function only works with hi-colour sprites.
Example:
DynamicSprite* sprite = DynamicSprite.CreateFromExistingSprite(object[0].Graphic);
sprite.Tint(255, 0, 0, 100, 100);
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawImage(100, 80, sprite.Graphic);
surface.Release();
sprite.Delete();
creates a copy of object 0's sprite, tints it red, and draws it onto the room background.
See Also: DynamicSprite.Flip,
DynamicSprite.Height,
DynamicSprite.Width,
SetAmbientTint
|