Forum > Graphics

Demoscene The Champs Cracktro

<< < (2/2)

KodeZwerg:
Here are some copperbars :D

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit uMain; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,  BGLVirtualScreen, BGRAOpenGL, BGRABitmap,  BGRABitmapTypes, BGRAGradientScanner; type  TCopperBar = packed record    Gradient: TBGRACustomGradient;    Y: Integer;    Size: Integer;    IsAdd: Boolean;  end;  TCopperBars = array of TCopperBar; type   { TForm1 }   TForm1 = class(TForm)    BGLVirtualScreen1: TBGLVirtualScreen;    Panel1: TPanel;    Timer1: TTimer;    procedure BGLVirtualScreen1Redraw(Sender: TObject; BGLContext: TBGLContext);    procedure BGLVirtualScreen1Resize(Sender: TObject);    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);    procedure FormShow(Sender: TObject);    procedure Timer1Timer(Sender: TObject);  strict private    FCB: TCopperBars;    FMaxBars: Integer;  private    procedure ReleaseCB;    procedure GenerateCB(const AMaxBars: Integer);  public  end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.BGLVirtualScreen1Redraw(Sender: TObject;  BGLContext: TBGLContext);var  i: Integer;  sy: Integer;begin  for i := High(FCB) downto Low(FCB) do    for sy := 0 to FCB[i].Size do      begin        if FCB[i].IsAdd then          Inc(FCB[i].Y)        else          Dec(FCB[i].Y);        if FCB[i].Y < BGLContext.Canvas.ClipRect.Top then          FCB[i].IsAdd := True;        if FCB[i].Y > BGLContext.Canvas.ClipRect.Height then          FCB[i].IsAdd := False;        BGLContext.Canvas.FillRect(0, FCB[i].Y, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y), FCB[i].Gradient.GetColorAtF(sy));        if FCB[i].IsAdd then          BGLContext.Canvas.FillRect(0, FCB[i].Y - FCB[i].Size, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y - FCB[i].Size), FCB[i].Gradient.GetColorAtF(FCB[i].Size - sy))        else          BGLContext.Canvas.FillRect(0, FCB[i].Y + FCB[i].Size, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y + FCB[i].Size), FCB[i].Gradient.GetColorAtF(FCB[i].Size - sy));      end;end; procedure TForm1.BGLVirtualScreen1Resize(Sender: TObject);begin  ReleaseCB;  GenerateCB(FMaxBars);end; procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);begin  ReleaseCB;  CloseAction := caFree;end; procedure TForm1.FormShow(Sender: TObject);begin  Randomize;  GenerateCB(10);  Timer1.Interval := 50;  Timer1.Enabled := True;end; procedure TForm1.Timer1Timer(Sender: TObject);begin  BGLVirtualScreen1.Repaint;end; procedure TForm1.ReleaseCB;var  i: Integer;begin  for i := High(FCB) downto Low(FCB) do    begin      FCB[i].Size := 0;      FCB[i].Y := 0;      FCB[i].IsAdd := False;      FCB[i].Gradient.Free;      FCB[i].Gradient := nil;    end;end; procedure TForm1.GenerateCB(const AMaxBars: Integer);var  i: Integer;  Y: Integer;begin  FMaxBars := AMaxBars;  SetLength(FCB, FMaxBars);  Y := BGLVirtualScreen1.Height;  for i := Low(FCB) to High(FCB) do    begin      FCB[i].Size := 10;      Y := Y - (FCB[i].Size);      FCB[i].Y := Y;      FCB[i].Gradient := TBGRAMultiGradient.Create([RGBToColor(Random(High(Byte)), Random(High(Byte)), Random(High(Byte))), clBlackOpaque], [0, FCB[i].Size], True, False);      FCB[i].IsAdd := True;    end;end; end.

KodeZwerg:
Copperbars -> Shadowbars!
Switched to the BGRA version for easier bitmap manipulation.
Switched to a fixed autocolored version with a nice shadow effect (gradient color switching)
Hope its useful to someone.
Heres the code, in attachment a full working demo project.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit uMain; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Spin,  StdCtrls, BGRABitmap, BGRABitmapTypes,  BGRAGradientScanner, BGRAVirtualScreen, BCTypes; type  TCopperBar = packed record    Gradient: TBGRACustomGradient;    Y: Integer;    Size: Integer;    IsAdd: Boolean;  end;  TCopperBars = array of TCopperBar; type   { TForm1 }   TForm1 = class(TForm)    BGRAVirtualScreen1: TBGRAVirtualScreen;    Label1: TLabel;    Label2: TLabel;    Label3: TLabel;    Panel1: TPanel;    SpinEdit1: TSpinEdit;    SpinEdit2: TSpinEdit;    SpinEdit3: TSpinEdit;    Timer1: TTimer;    procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);    procedure BGRAVirtualScreen1Resize(Sender: TObject);    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);    procedure FormShow(Sender: TObject);    procedure SpinEdit1Change(Sender: TObject);    procedure SpinEdit2Change(Sender: TObject);    procedure SpinEdit3Change(Sender: TObject);    procedure Timer1Timer(Sender: TObject);  strict private    FCB: TCopperBars;    FMaxBars: Integer;  private    procedure ReleaseCB;    procedure GenerateCB;  public  end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);var  i: Integer;  sy: Integer;  bmp: TBGRABitmap;begin  bmp := TBGRABitmap.Create(BGRAVirtualScreen1.Width, BGRAVirtualScreen1.Height);  bmp.Canvas.Brush.Color := BGRAVirtualScreen1.Color;  bmp.Canvas.FillRect(bmp.Canvas.ClipRect);  try    for i := High(FCB) downto Low(FCB) do      begin        for sy := 0 to FCB[i].Size do          begin            if FCB[i].IsAdd then              Inc(FCB[i].Y)            else              Dec(FCB[i].Y);            if (FCB[i].Y < (bmp.Canvas.ClipRect.Top - FCB[i].Size)) then              FCB[i].IsAdd := True;            if (FCB[i].Y > (bmp.Canvas.ClipRect.Height + FCB[i].Size)) then              FCB[i].IsAdd := False;            bmp.Canvas.Brush.Color := FCB[i].Gradient.GetColorAtF(sy);            bmp.Canvas.FillRect(bmp.Canvas.ClipRect.Left, FCB[i].Y, bmp.Canvas.ClipRect.Width, Succ(FCB[i].Y));            bmp.Canvas.Brush.Color := FCB[i].Gradient.GetColorAtF(FCB[i].Size - sy);            if FCB[i].IsAdd then              bmp.Canvas.FillRect(bmp.Canvas.ClipRect.Left, FCB[i].Y - FCB[i].Size, bmp.Canvas.ClipRect.Width, Succ(FCB[i].Y - FCB[i].Size))            else              bmp.Canvas.FillRect(bmp.Canvas.ClipRect.Left, FCB[i].Y + FCB[i].Size, bmp.Canvas.ClipRect.Width, Succ(FCB[i].Y + FCB[i].Size));          end;      end;    Bitmap.Assign(bmp);  finally    bmp.Free;  end;end; procedure TForm1.BGRAVirtualScreen1Resize(Sender: TObject);begin  Timer1.Enabled := False;  ReleaseCB;  GenerateCB;  Timer1.Enabled := True;end;  procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);begin  Timer1.Enabled := False;  ReleaseCB;  CloseAction := caFree;end; procedure TForm1.FormShow(Sender: TObject);begin  Randomize;  GenerateCB;  Timer1.Interval := SpinEdit3.Value;  Timer1.Enabled := True;end; procedure TForm1.SpinEdit1Change(Sender: TObject);begin  Timer1.Enabled := False;  ReleaseCB;  GenerateCB;  Timer1.Enabled := True;end; procedure TForm1.SpinEdit2Change(Sender: TObject);begin  Timer1.Enabled := False;  ReleaseCB;  GenerateCB;  Timer1.Enabled := True;end; procedure TForm1.SpinEdit3Change(Sender: TObject);begin  Timer1.Interval := SpinEdit3.Value;end; procedure TForm1.Timer1Timer(Sender: TObject);begin  BGRAVirtualScreen1.RedrawBitmap;end; procedure TForm1.ReleaseCB;var  i: Integer;begin  for i := High(FCB) downto Low(FCB) do    begin      FCB[i].Size := 0;      FCB[i].Y := 0;      FCB[i].IsAdd := False;      FCB[i].Gradient.Free;      FCB[i].Gradient := nil;    end;  SetLength(FCB, 0);  FCB := nil;end; procedure TForm1.GenerateCB;var  i: Integer;  Y: Integer;  Gradient: TBGRACustomGradient;begin  Y := BGRAVirtualScreen1.Height;  FMaxBars := Succ(Round(Y / SpinEdit2.Value) * 2);  SpinEdit1.Value := FMaxBars;  SetLength(FCB, FMaxBars);  Gradient := TBGRAMultiGradient.Create([RGBToColor(Random(High(Byte)), Random(High(Byte)), Random(High(Byte))), clBlackOpaque], [0, FMaxBars], True, False);  try    for i := Low(FCB) to High(FCB) do      begin        FCB[i].Size := SpinEdit2.Value;        Y := Y - (FCB[i].Size);        FCB[i].Y := Y;        FCB[i].Gradient := TBGRAMultiGradient.Create([Gradient.GetColorAtF(i), clBlackOpaque], [0, FCB[i].Size], True, False);        FCB[i].IsAdd := True;      end;  finally    Gradient.Free;  end;end; end.

Gigatron:
Hi, very good job, thank you for the copper bars ;

Now just a nice bitmap scroller for the the champs cracktro, not yet included to the cracktro but usefull for anyone
to learn bitmap scrolling text under 100 lines of code ;




--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,  BGRABitmap, BGRABitmapTypes, BGRAVirtualScreen; const     ascii : Array [0..58] of integer = (26,37,99,99,99,99,99,41,42,43,99,99,44,99,38,99,27,28,29,30,31,32,33,34,35,36,40,99,99,99,99,39,99,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);  var  CharImage: TBGRABitmap;  ScrollSpeed: integer = 2;  ScrollCounter: integer = 1;  CharWidth : integer = 16;  CharHeight :  integer = 22;  CharsPerLine : integer = 700;  ScrollText2: String = '                                           YEAH OF COURSE !!!  ))))) THE CHAMPS (((((  PRESENT : SIDEWINDER CRACKED BY DELTA FORCE    THE BEST SALUTE GO TO : HOTLINE HIGH QUALITY CRACKINGS DELTA FORCE AND TRISTAR(THE BEST GET BETTER !!!)    THE SPECIAL GREETINGS IN ALPHABETICAL ORDER GO TO : AXXESS ANTITRAX BFBS BLIZZARDS BS1 BST CCW ERNIE FREE NETWORK GENERAL INDY IBB KNIGHT HAWKS MEGAFORCE NEW AGE MR.NEWLOOK NORTHERN LIGHTS POWERXTREME RANDOM ACCESS RED SECTOR SKYLINE TLC TOM VISITOR WIZARDS AND ALL THE OTHERS WE KNOW....   COMMING SOON MORE AND MORE NEW PRG FROM THE UNATTAINABLE   ))))) THE CHAMPS ((((( IN 1988 !!!!!                                                                         '; type   { TForm1 }   TForm1 = class(TForm)    BGRAVirtualScreen1: TBGRAVirtualScreen;    Timer1: TTimer;    procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);    procedure FormCreate(Sender: TObject);    procedure Timer1Timer(Sender: TObject);  private   public   end;  var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin   CharImage := TBGRABitmap.Create('font.png'); end; procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);var   I,   Chr: Integer;   CharX, CharY: Integer;   ScrollOffset: Integer; begin  Bitmap.Fill(BGRAPixelTransparent);  ScrollOffset :=  ScrollCounter ;    for I := 0 to Length(ScrollText2) do    begin       Chr := Ord(ScrollText2[I]);       CharX := ((I - 1) mod CharsPerLine) * CharWidth - ScrollOffset  ;       CharY := ((I - 1) div CharsPerLine) * CharHeight  ;       Bitmap.PutImagePart(CharX ,240+CharY , CharImage, Rect(0, 24*ascii[chr-32] , 15, 24*ascii[chr-32]+CharHeight), dmDrawWithTransparency);    end;      ScrollCounter := ScrollCounter + ScrollSpeed;      if ScrollCounter >= CharWidth then    begin    ScrollCounter := ScrollCounter - CharWidth;    ScrollText2 := Copy(ScrollText2,2, Length(ScrollText2) - 1) + ScrollText2[1];  end; end; procedure TForm1.Timer1Timer(Sender: TObject);begin      BGRAVirtualScreen1.RedrawBitmap;end; end. 

Navigation

[0] Message Index

[*] Previous page

Go to full version