PDA

View Full Version : Different RGB's



Jonne
21-09-2006, 05:21 PM
Is there way to draw white picture with different color?

Traveler
21-09-2006, 07:01 PM
I think you need to explain that a bit more as I (and probably more of us) do not understand with you mean by that.

Jonne
21-09-2006, 08:10 PM
Yes, sorry for lack of explaining. I'm quite poor in english, so this is hard. :)

I've been working soccer game, where shirts, pants, socks etc is in white colori. I'm using currently omega components, where I can draw white shirt ie. to red.

So I was wondering, how it works with DelphiX.

Here is original sprite picture.
http://pp.kpnet.fi/kmje/shirts1.png

And this, what I'm looking for. (drawing it to different RGB)
http://www.netsoccer.biz/screenshot1.gif

ijcro
21-09-2006, 08:34 PM
I don't understand you well, but I think than you want use one set of pictures and recolor it on fly.

When it is right, you can use function (and other similar) for drawing like



procedure DrawAlphaCol(Dest: TDirectDrawSurface; const DestRect: TRect; PatternIndex: Integer;
Color: Integer; Alpha: Integer{$IFDEF DelphiX_Spt4} = 255{$ENDIF});


where Color is parameter for set color of vertex as well and set color for drawing like


Color := DXDraw.Surface.ColorMatch(clYellow);

But I no tried it, sorry.

Jonne
28-09-2006, 04:09 PM
Thanks, I got it working.



dxImageList1.Items[0].DrawAddCol(DXDraw1.Surface, Bounds(10, 10, 20, 20),0,RGB(50, 150, 50), 255);

Speeeder
01-10-2006, 03:08 PM
Additive drawing for clothes? :P Use DrawAlpha at 255 :)

ijcro
02-10-2006, 07:42 PM
I am sorry, so I think that I forgot simple draw with vertex coloring... :oops: