Page 1 of 1

first color in a sprite

Posted: Tue Apr 12, 2005 1:04 am
by Hroudtwolf
Hello comunity,


My program should load many sprites with different backgroundcolors.
Then it should display the sprites transparent.
The most certain method could be select the first color in the upper left of the sprite and setting this color as transparentcolor.

Now my question:

How to determine the first color in the upper left of a sprite without displaying at first?

Posted: Tue Apr 12, 2005 1:16 am
by Hroudtwolf
My brains functions again. :-)

Here is the solution.

Code: Select all

Procedure ErsteFarbeTransparent(sprite.l)
If StartDrawing (SpriteOutput(sprite.l))
farbe.l=Point(0,0)
StopDrawing ()
EndIf 
TransparentSpriteColor(sprite.l,Red(farbe.l),Green(farbe.l),Blue(farbe.l))
EndProcedure 

Posted: Tue Apr 12, 2005 1:21 am
by Shannara
Perfect, this should be moved to Tips & Tricks :)

Posted: Thu Apr 14, 2005 1:50 am
by griz
What if the sprite needs that pixel for color data?

Posted: Thu Apr 14, 2005 2:08 am
by Hroudtwolf
Then, you must write another position in >POINT(x,y)<.