- Timestamp:
- May 7, 2015, 12:20:50 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UEngine.pas
r34 r35 11 11 type 12 12 TStationShape = (ssCircle, ssSquare, ssTriangle, ssStar, ssPlus, ssPentagon, 13 ssDiamond );13 ssDiamond, ssQuarterCircle, ssHexagon, ssCross, ssHalfCircle, ssHeptagon); 14 14 TStationShapeSet = set of TStationShape; 15 15 TEngine = class; … … 1426 1426 Canvas.Polygon(Points); 1427 1427 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; 1428 1438 ssDiamond: begin 1429 1439 SetLength(Points, 4); … … 1432 1442 Points[2] := Point(Position.X, Position.Y + Size div 2); 1433 1443 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; 1434 1481 Points := RotatePoints(Position, Points, Angle); 1435 1482 Canvas.Polygon(Points); … … 2316 2363 // Status interface 2317 2364 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); 2319 2366 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); 2321 2368 2322 2369 DrawClock(TargetCanvas); -
trunk/UFormMain.pas
r33 r35 51 51 begin 52 52 Engine := TEngine.Create; 53 PaintBox1.ControlStyle := [csOpaque];53 //PaintBox1.ControlStyle := [csOpaque]; 54 54 end; 55 55
Note:
See TracChangeset
for help on using the changeset viewer.