Changeset 126 for trunk/UGame.pas
- Timestamp:
- Jun 17, 2017, 2:54:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r125 r126 128 128 procedure SelectCell(Pos: TPoint; Player: TPlayer; ShiftState: TShiftState); 129 129 procedure CenterMap; 130 procedure CenterPlayerCity(Player: TPlayer); 130 131 function CanvasToCellPos(Pos: TPoint): TPoint; 131 132 function CellToCanvasPos(Pos: TPoint): TPoint; … … 2226 2227 end; 2227 2228 2229 procedure TView.CenterPlayerCity(Player: TPlayer); 2230 begin 2231 SourceRect := Bounds(Player.StartCell.PosPx.X - (SourceRect.Right - SourceRect.Left) div 2, 2232 Player.StartCell.PosPx.Y - (SourceRect.Bottom - SourceRect.Top) div 2, 2233 SourceRect.Right - SourceRect.Left, 2234 SourceRect.Bottom - SourceRect.Top); 2235 end; 2236 2228 2237 procedure TPlayer.Paint(Canvas: TCanvas; View: TView); 2229 2238 begin … … 3048 3057 View.Clear; 3049 3058 View.Zoom := 1; 3050 View.CenterMap; 3059 if Assigned(ControlPlayer) then View.CenterPlayerCity(ControlPlayer) 3060 else View.CenterMap; 3051 3061 end; 3052 3062 end;
Note:
See TracChangeset
for help on using the changeset viewer.