Changeset 62 for trunk/Packages


Ignore:
Timestamp:
Nov 25, 2020, 4:25:09 PM (4 years ago)
Author:
chronos
Message:
  • Added: Main game menu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UMetaCanvas.pas

    r60 r62  
    66
    77uses
    8   Classes, SysUtils, Graphics, Contnrs, Types;
     8  Classes, SysUtils, Graphics, Contnrs, Types, fgl;
    99
    1010type
     
    1717    procedure Zoom(Factor: Double); virtual;
    1818    procedure Move(Delta: TPoint); virtual;
     19  end;
     20
     21  TCanvasObjects = class(TFPGObjectList<TCanvasObject>)
    1922  end;
    2023
     
    133136    procedure DoLineTo(X, Y: Integer); override;
    134137  public
    135     Objects: TObjectList;
     138    Objects: TCanvasObjects;
    136139    procedure FillRect(const ARect: TRect); overload; override;
    137140    procedure FillRect(X1,Y1,X2,Y2: Integer); overload;
     
    154157  end;
    155158
     159
    156160implementation
    157161
     
    198202  Pen.Free;
    199203  Brush.Free;
    200   inherited Destroy;
     204  inherited;
    201205end;
    202206
     
    228232destructor TCanvasStretchDraw.Destroy;
    229233begin
    230   inherited Destroy;
     234  inherited;
    231235end;
    232236
     
    264268  Pen.Free;
    265269  Brush.Free;
    266   inherited Destroy;
     270  inherited;
    267271end;
    268272
     
    304308  Brush.Free;
    305309  Pen.Free;
    306   inherited Destroy;
     310  inherited;
    307311end;
    308312
     
    336340begin
    337341  Pen.Free;
    338   inherited Destroy;
     342  inherited;
    339343end;
    340344
     
    375379  Pen.Free;
    376380  Brush.Free;
    377   inherited Destroy;
     381  inherited;
    378382end;
    379383
     
    408412  Brush.Free;
    409413  Font.Free;
    410   inherited Destroy;
     414  inherited;
    411415end;
    412416
     
    633637begin
    634638  for I := 0 to Objects.Count - 1 do
    635     TCanvasObject(Objects[I]).Paint(Canvas);
     639    Objects[I].Paint(Canvas);
    636640end;
    637641
     
    641645begin
    642646  for I := 0 to Objects.Count - 1 do
    643     TCanvasObject(Objects[I]).Zoom(Factor);
     647    Objects[I].Zoom(Factor);
    644648end;
    645649
     
    649653begin
    650654  for I := 0 to Objects.Count - 1 do
    651     TCanvasObject(Objects[I]).Move(Delta);
     655    Objects[I].Move(Delta);
    652656end;
    653657
     
    656660  inherited;
    657661  FPenPos := Point(0, 0);
    658   Objects := TObjectList.Create;
     662  Objects := TCanvasObjects.Create;
    659663end;
    660664
     
    662666begin
    663667  Objects.Free;
    664   inherited Destroy;
     668  inherited;
    665669end;
    666670
Note: See TracChangeset for help on using the changeset viewer.