Debian Codegraph @

examples/platformer/code/gameviewcontrolshelp.pas

raw
1 {
2 Copyright 2024-2024 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 { Show mobile controls help. }
17 unit GameViewControlsHelp;
18
19 interface
20
21 uses Classes,
22 CastleVectors, CastleUIControls, CastleControls, CastleKeysMouse;
23
24 type
25 TViewControlsHelp = class(TCastleView)
26 published
27 { Components designed using CGE editor.
28 These fields will be automatically initialized at Start. }
29 ButtonOK: TCastleButton;
30 private
31 procedure ClickMenu(Sender: TObject);
32 public
33 constructor Create(AOwner: TComponent); override;
34 procedure Start; override;
35 end;
36
37 var
38 ViewControlsHelp: TViewControlsHelp;
39
40 implementation
41
42 constructor TViewControlsHelp.Create(AOwner: TComponent);
43 begin
44 inherited;
45 DesignUrl := 'castle-data:/gameviewcontrolshelp.castle-user-interface';
46 end;
47
48 procedure TViewControlsHelp.Start;
49 begin
50 inherited;
51 ButtonOK.OnClick := {$ifdef FPC}@{$endif}ClickMenu;
52 InterceptInput := true;
53 end;
54
55 procedure TViewControlsHelp.ClickMenu(Sender: TObject);
56 begin
57 Container.PopView(Self);
58 end;
59
60 end.