Changeset 35 for trunk


Ignore:
Timestamp:
May 7, 2015, 12:20:50 AM (10 years ago)
Author:
chronos
Message:
  • Added: More station shapes.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UEngine.pas

    r34 r35  
    1111type
    1212  TStationShape = (ssCircle, ssSquare, ssTriangle, ssStar, ssPlus, ssPentagon,
    13     ssDiamond);
     13    ssDiamond, ssQuarterCircle, ssHexagon, ssCross, ssHalfCircle, ssHeptagon);
    1414  TStationShapeSet = set of TStationShape;
    1515  TEngine = class;
     
    14261426      Canvas.Polygon(Points);
    14271427    end;
     1428    ssHexagon: begin
     1429      SetLength(Points, 6);
     1430      for I := 0 to 5 do begin
     1431        Angle2 := I / 6 * 2 * Pi - Pi / 2;
     1432        Points[I] := Point(Round(Position.X + Cos(Angle2) * Size / 2),
     1433          Round(Position.Y + Sin(Angle2) * Size / 2));
     1434      end;
     1435      Points := RotatePoints(Position, Points, Angle);
     1436      Canvas.Polygon(Points);
     1437    end;
    14281438    ssDiamond: begin
    14291439      SetLength(Points, 4);
     
    14321442      Points[2] := Point(Position.X, Position.Y + Size div 2);
    14331443      Points[3] := Point(Position.X - Size div 2, Position.Y);
     1444      Points := RotatePoints(Position, Points, Angle);
     1445      Canvas.Polygon(Points);
     1446    end;
     1447    ssCross: begin
     1448      SetLength(Points, 12);
     1449      Points[0] := Point(Position.X + Size div 6, Position.Y - Size div 6);
     1450      Points[1] := Point(Position.X + Size div 2, Position.Y - Size div 6);
     1451      Points[2] := Point(Position.X + Size div 2, Position.Y + Size div 6);
     1452      Points[3] := Point(Position.X + Size div 6, Position.Y + Size div 6);
     1453      Points[4] := Point(Position.X + Size div 6, Position.Y + Size div 2);
     1454      Points[5] := Point(Position.X - Size div 6, Position.Y + Size div 2);
     1455      Points[6] := Point(Position.X - Size div 6, Position.Y + Size div 6);
     1456      Points[7] := Point(Position.X - Size div 2, Position.Y + Size div 6);
     1457      Points[8] := Point(Position.X - Size div 2, Position.Y - Size div 6);
     1458      Points[9] := Point(Position.X - Size div 6, Position.Y - Size div 6);
     1459      Points[10] := Point(Position.X - Size div 6, Position.Y - Size div 2);
     1460      Points[11] := Point(Position.X + Size div 6, Position.Y - Size div 2);
     1461      Points := RotatePoints(Position, Points, Angle + Pi / 4);
     1462      Canvas.Polygon(Points);
     1463    end;
     1464    ssHalfCircle: Canvas.Pie(
     1465      Position.X - Size div 2, Position.Y - Size div 2,
     1466      Position.X + Size div 2, Position.Y + Size div 2,
     1467      Position.X - Size div 2, Position.Y,
     1468      Position.X + Size div 2, Position.Y);
     1469    ssQuarterCircle: Canvas.Pie(
     1470      Position.X - Size div 2 - Size, Position.Y - Size div 2,
     1471      Position.X + Size div 2, Position.Y + Size div 2 + Size,
     1472      Position.X + Size div 2, Position.Y + Size div 2,
     1473      Position.X - Size div 2, Position.Y - Size div 2);
     1474    ssHeptagon: begin
     1475      SetLength(Points, 8);
     1476      for I := 0 to High(Points) do begin
     1477        Angle2 := I / Length(Points) * 2 * Pi - Pi / 2;
     1478        Points[I] := Point(Round(Position.X + Cos(Angle2) * Size / 2),
     1479          Round(Position.Y + Sin(Angle2) * Size / 2));
     1480      end;
    14341481      Points := RotatePoints(Position, Points, Angle);
    14351482      Canvas.Polygon(Points);
     
    23162363  // Status interface
    23172364  Text := IntToStr(ServedPassengerCount);
    2318   TargetCanvas.Draw(TargetCanvas.Width - 100, TargetCanvas.Height - 60, ImagePassenger.Picture.Bitmap);
     2365  TargetCanvas.Draw(TargetCanvas.Width - 50, TargetCanvas.Height - 60, ImagePassenger.Picture.Bitmap);
    23192366  TargetCanvas.Brush.Style := bsClear;
    2320   TargetCanvas.TextOut(TargetCanvas.Width - 50 - TargetCanvas.TextWidth(Text), TargetCanvas.Height - 55, Text);
     2367  TargetCanvas.TextOut(TargetCanvas.Width - 70 - TargetCanvas.TextWidth(Text), TargetCanvas.Height - 55, Text);
    23212368
    23222369  DrawClock(TargetCanvas);
  • trunk/UFormMain.pas

    r33 r35  
    5151begin
    5252  Engine := TEngine.Create;
    53   PaintBox1.ControlStyle := [csOpaque];
     53  //PaintBox1.ControlStyle := [csOpaque];
    5454end;
    5555
Note: See TracChangeset for help on using the changeset viewer.