Bebe
2006-06-12 02:24:19
I saw the drawing functions/procedures in the SCAR manual lately and I wondered how and why they would be used, so I found an example by kait and changed it a little bit.
Have fun:
Have fun:
program FastDrawScar;
type
TDirection = (dirLeft, dirRight);
var
Buffer: Integer;
bull, bull2: Integer;
f: Integer;
Direction: TDirection;
x: Integer;
begin
DisplayDebugImgWindow(300, 300);
bull := BitmapFromString(38, 31, 'z78DAEDD8D10E82300C05D05F' +
'3242501ECD22FFFF49C615C295AE63A355375D97ECC168E478B73' +
'A7027D7461B9181F5ABAE691A8665AEDD2BB9A4B9166FAEAB46EF' +
'7C55AEEB74C66972AE6C234A73BC4F17EA8A5EB7DE95E60DBB4AD' +
'6A188F655607FCDD2ADEBEAEBEEAB3423EF339823BD424ED4E23B' +
'514DD212D28CF74F346E5394EDE8C56453BCB6BF06DF5F7CAFF1F' +
'D2819B1A4AC77F285EFB2D2E195F0F9D53B8ECB9C624CEBC3DB1E' +
'F57963BA37B41F25D7FA59F13F947772B5F1C22ADF1B3BE1C8AED' +
'889487F72C03E4045BADED7516FB853E5B82C4F47543D94AD376E' +
'CC39091F97A2F1E6EB1D5EA923EDB9706D6BD33CFB220B97EABD4' +
'75DABCE2A4D49AAC937ED9E25EEB25FB7E8D5E72B1BF35C7C3DD8' +
'9EEB72F3C53443C66FBAACF2A5D7E5344B7169F24D4BB32C576EB' +
'EB82B03F7C8701F5AD7133CA9FEE7496C1B6DB4C1C703370407A8' +
'');
bull2:= CreateMirroredBitmap(bull);
Buffer:= BitmapFromString(300, 300, '');
SetTransparentColor(bull, clWhite);
SetTransparentColor(bull2, clWhite);
x:= 0;
repeat
FastDrawClear(Buffer, clGreen);
for f:= 0 to 50 do
begin
FastDrawTransparent(Random(380) - 80, Random(380) - 80, bull, Buffer);
FastDrawTransparent(Random(380) - 80, Random(380) - 80, bull2, Buffer);
end;
if(Direction = dirRight)then
FastDrawSizeTransparent(x, 50, x + 200, 250, bull, Buffer)
else
FastDrawSizeTransparent(x, 50, x + 200, 250, bull2, Buffer);
if(Direction = dirRight)then
x:= x + 1;
if(Direction = dirLeft)then
x:= x - 1;
if(x <= 0)then
Direction:= dirRight;
if(x >= 100)then
Direction:= dirLeft;
SafeDrawBitmap(Buffer, GetDebugCanvas, 0, 0);
until(False);
end.