Debian Codegraph @

examples/tiled/strategy_game_demo/code/gameviewinstructions2.pas

raw
1 {
2 Copyright 2018-2023 Michalis Kamburelis.
3
4 This file is part of "Castle Game Engine".
5
6 "Castle Game Engine" is free software; see the file COPYING.txt,
7 included in this distribution, for details about the copyright.
8
9 "Castle Game Engine" is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 ----------------------------------------------------------------------------
14 }
15
16 { Display instructions, part 2 - about units and map. }
17 unit GameViewInstructions2;
18
19 interface
20
21 uses Classes,
22 CastleVectors, CastleUIControls, CastleControls, CastleKeysMouse;
23
24 type
25 TViewInstructions2 = class(TCastleView)
26 published
27 { Components designed using CGE editor.
28 These fields will be automatically initialized at Start. }
29 ButtonClose: TCastleButton;
30 strict private
31 procedure ClickClose(Sender: TObject);
32 public
33 constructor Create(AOwner: TComponent); override;
34 procedure Start; override;
35 end;
36
37 var
38 ViewInstructions2: TViewInstructions2;
39
40 implementation
41
42 constructor TViewInstructions2.Create(AOwner: TComponent);
43 begin
44 inherited;
45 DesignUrl := 'castle-data:/gameviewinstructions2.castle-user-interface';
46 end;
47
48 procedure TViewInstructions2.Start;
49 begin
50 inherited;
51
52 ButtonClose.OnClick := {$ifdef FPC}@{$endif}ClickClose;
53
54 { do not pass clicks to view underneath }
55 InterceptInput := true;
56 end;
57
58 procedure TViewInstructions2.ClickClose(Sender: TObject);
59 begin
60 Container.PopView(Self);
61 end;
62
63 end.