Code: Select all
DisplayTransparentSprite(#Sprite, x, y [, Intensity [, Color]])
Most of the time this works! So, I must be on the right track...
But something is weird and I think it has to do with the fact that the monochrome colored sprite's RGB component isn't premultiplied with it's alpha component.
Let me explain:
I draw the original sprite first like this
Code: Select all
SpriteBlendingMode(#PB_Sprite_BlendSourceAlpha,#PB_Sprite_BlendInvertSourceAlpha)
DisplayTransparentSprite(#Sprite,x,y,Alpha)
Code: Select all
SpriteBlendingMode(#PB_Sprite_BlendDestinationColor,#PB_Sprite_BlendInvertSourceAlpha)
DisplayTransparentSprite(#Sprite,x,y,255, Color)
Code: Select all
SpriteBlendingMode(#PB_Sprite_BlendDestinationColor,#PB_Sprite_BlendInvertDestinationAlpha)
DisplayTransparentSprite(#Sprite,x,y,255, Color)
So my questions :
- Is it true that Purebasic monochrome colored sprites are ment to be used for color compositing?
- Why no premultiply?
Hope this makes sense...
A nice explanation what I try to achieve :
http://amindforeverprogramming.blogspot ... nding.html