home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 January
/
Chip_1999-01_cd.bin
/
zkuste
/
delphi
/
D1
/
CARDS.ZIP
/
readme.txt
< prev
Wrap
Text File
|
1995-11-16
|
2KB
|
89 lines
TCards
This VCL allows the user to easily use the cards supplied with
Windows in the CARDS.DLL, and build games.
PROPERTIES
CardBack: This is the style of the design used to draw the
card when CardStyle is set to cdBack. Possible
values range from 1 - 12.
CardStyle: This depicts how the card will be drawn. Possible
values are:
cdBack: Draw card back design
cdFront: Draw card front
cdO: Draw placeholder card
cdX: Draw invalid placeholder card
Selected: When selected is true, card is drawn inversed, else
card is drawn normal.
Suit: Depicts what suit the given card is. Possible
values are:
0: Clubs
1: Diamonds
2: Hearts
3: Spades
Value: Depicts the value of the card using the formula:
Value:=FaceValue + (Suit * 13);
Conversely:
FaceValue:=Value - (Suit * 13);
Installing TCards
To install this VCL, copy both CARDS.DCU and CARDS.DCR to the
directory where you have your other shareware controls. Then,
from Delphi's main menu, select Options|Install Components. In the
dialog, click on the Add... button, then Browse... and change to the
drive/directory where you stored the above two files. Select
CARDS.DCU and click OK, then OK again.
Using TCARDS
To use this control, simply place it on your form, and edit the
CardBack, CardStyle, Suit, and Value properties.
Sample Procedures:
procedure initdeck;
var
i:integer;
begin
{Initializes deck array, do once per program, or to reset}
{deck[1..52] is a global array}
for i:= 1 to 52 do
deck[i]:=i;
end;
procedure shuffledeck;
var
i,j,k,temp:integer;
begin
{deck[1..52] is a global array}
Randomize;
For i := 1 To 10 do
For j := 1 To 52 do
begin
k := trunc(1 + (52 * Random));
temp := deck[j];
deck[j] := deck[k];
deck[k] := temp;
end;
end;
Registering TCards
To register TCards and receive source code, send $10 (+$2 S&H) to:
Indigo Software
4240 Park Newport # 308
Newport Beach, CA 92660
You can save the $2 shipping fee by specifying a Compuserve or AOL
account to have your control sent to instead of by mail.