Changeset 417 for trunk/UBrain.pas
- Timestamp:
- Nov 17, 2021, 11:11:01 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UBrain.pas
r375 r417 6 6 7 7 uses 8 Classes, SysUtils, fgl, Graphics, Protocol, LazFileUtils, dynlibs ;8 Classes, SysUtils, fgl, Graphics, Protocol, LazFileUtils, dynlibs, Types; 9 9 10 10 const … … 35 35 Picture: TBitmap; 36 36 Beginner: Boolean; 37 procedure LoadPicture; 37 38 procedure LoadFromFile(AIFileName: string); 38 39 constructor Create; … … 47 48 procedure GetByKind(Kind: TBrainType; Brains: TBrains); 48 49 function GetBeginner: TBrain; 50 procedure LoadPictures; 49 51 end; 50 52 … … 53 55 54 56 uses 55 ScreenTools ;57 ScreenTools, Directories; 56 58 57 59 { TBrain } 60 61 procedure TBrain.LoadPicture; 62 var 63 TextSize: TSize; 64 begin 65 if not LoadGraphicFile(Picture, GetAiDir + DirectorySeparator + 66 FileName + DirectorySeparator + FileName + '.png', [gfNoError]) then begin 67 with Picture.Canvas do begin 68 Brush.Color := $904830; 69 FillRect(Rect(0, 0, 64, 64)); 70 Font.Assign(UniFont[ftTiny]); 71 Font.Style := []; 72 Font.Color := $5FDBFF; 73 TextSize := TextExtent(FileName); 74 TextOut(32 - TextSize.Width div 2, 32 - TextSize.Height div 2, FileName); 75 end; 76 end; 77 end; 58 78 59 79 procedure TBrain.LoadFromFile(AIFileName: string); … … 177 197 end; 178 198 199 procedure TBrains.LoadPictures; 200 var 201 I: Integer; 202 begin 203 for I := 0 to Count - 1 do 204 with Items[I] do LoadPicture; 205 end; 206 207 179 208 end. 180 209
Note:
See TracChangeset
for help on using the changeset viewer.