Autor Beitrag
J:org
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 02.12.03 08:44 
hi, ich bräucht eben mal eure hilfe und zwar komm ich hier nicht weiter...mein karospielfeld ist nur gestreift :)
ausblenden volle Höhe Delphi-Quelltext
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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
var
i,x,y,modtemp: integer;

begin
  form1.Canvas.Pen.Color := clBlack;
  //Zeichnet das Spielfeld
  for i:=0 to 8 do
  begin
    canvas.MoveTo(60+i*50,60);
    canvas.LineTo(60+i*50,460);
    canvas.MoveTo(60,60+i*50);
    canvas.LineTo(460,60+i*50);
  end;

  x := 0;


  while x <> 18 do
  begin
    x := x + 2;
    for y := 1 to 8 do
    begin
      Form1.Canvas.Brush.Color := clWhite;
        Form1.Canvas.FillRect (Rect({left}50*(y)+11,{top}25*(x)+11,
{right}50*(y)+60,{bottom}50*(1)+50));
      modtemp := y mod 2;
      if modtemp = 0 then
      begin
        Form1.Canvas.Brush.Color := clGray;
        Form1.Canvas.FillRect(Rect({left}50*(y)+11,{top}25*(x)+11,
{right}50*(y)+60,{bottom}50*(1)+50));
      end;
    end;
  end;

  //Farbe wieder auf Hintergrundfarbe zurück setzen.
  form1.Canvas.Brush.Color := clBtnFace;

könnt ihr mir n tip geben was ich falsch mache? ich komm net drauf.

danke

J:org

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
J:org Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 02.12.03 11:59 
habs:
ausblenden volle Höhe Delphi-Quelltext
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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
var
i,x,y,modtemp: integer;

begin
  form1.Canvas.Pen.Color := clBlack;
  //Zeichnet das Spielfeld
  for i:=0 to 8 do
  begin
    canvas.MoveTo(60+i*50,60);
    canvas.LineTo(60+i*50,460);
    canvas.MoveTo(60,60+i*50);
    canvas.LineTo(460,60+i*50);
  end;

  x := 0;
  while x <> 8 do
  begin
    x := x + 1;
    for y := 1 to 8 do
    begin
      modtemp := y mod 2;
      if modtemp = 0 then
      begin
        Form1.Canvas.Brush.Color := clWhite;
        Form1.Canvas.FillRect(Rect({left}50*(y)+11,{top}50*(x)+11,
{right}50*(y)+60,{bottom}50*(x)+60));
      end
      else
      begin
        Form1.Canvas.Brush.Color := clGray;
        Form1.Canvas.FillRect(Rect({left}50*(y)+11,{top}50*(x)+11,
{right}50*(y)+60,{bottom}50*(x)+60));
      end;
    end;
  end;

    x := 0;
  while x <> 8 do
  begin
    x := x + 2;
    for y := 1 to 8 do
    begin
      modtemp := y mod 2;
      if modtemp = 0 then
      begin
        Form1.Canvas.Brush.Color := clGray;
        Form1.Canvas.FillRect(Rect({left}50*(y)+11,{top}50*(x)+11,
{right}50*(y)+60,{bottom}50*(x)+60));
      end
      else
      begin
        Form1.Canvas.Brush.Color := clWhite;
        Form1.Canvas.FillRect(Rect({left}50*(y)+11,{top}50*(x)+11,
{right}50*(y)+60,{bottom}50*(x)+60));
      end;
    end;
  end;

  //Farbe wieder auf Hintergrundfarbe zurück setzen.
  form1.Canvas.Brush.Color := clBtnFace;

  //Schriftformatierung
  font.Name:='Arial';
  font.Size:=20;

  for i:=1 to 8 do
  begin
    canvas.TextOut(i*50+25,20,chr(96+i));    //schreibt Buchstaben über Spielfeld
    canvas.TextOut(25,i*50+20,inttostr(i));  //schreibt Zahlen über Spielfeld
  end;

end;


Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.